261099 261099
  • 03-11-2020
  • Computers and Technology
contestada

What is the output of the following program?

for num in range(4):
print (num * 2)

Respuesta :

Cytokine
Cytokine Cytokine
  • 03-11-2020

The range() function with one parameter defaults to a starting value of 0 and has an ending value of the number specified exclusive.

range(4) is all the integers between 0 and 4 not including 4.

for num in range(4):

   print(num*2)

The output would be 0 2 4 6 all on separate lines.

Answer Link

Otras preguntas

Explain the four quantum numbers
Essay on knowledge is power
Which of these was a direct consequence of the Civil War? the disintegration of the Whig Party the addition of new states to the Union the use of popular sovere
a device that does work in an electrical circuit
If Cuba had entered into a trade agreement with an Asian country in 1903 without US approval, which of the following agreements or amendments would that agreeme
In 1734, a group of Austrian Protestants known as the Salzburgers arrived in the Georgia colony. What was the name of the settlement they built 25 miles northwe
Which best describe the tenets of the Bush Doctrine of the early 2000s? multilateralism, Realpolitik multilateralism, idealism unilateralism, Realpolitik unilat
In which of the following scenarios would the Board of Governors be most likely to intervene? (5 points) Economic data for the year are released and require ana
Supply the missing reason (s) for the given proof number 14
Early Renaissance music was much more complex, more fragmented, and more dissonant than that of the Middle Ages. True False