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

what is 36 divide by 837
Experts agree that the minimum time period for cardiorespiratory benefit from exercise is _______ minutes.      A. 20B. 10C. 60D. 30
what is the value of the tape diagram if the ratio is 8 to 7 and the total is 195
Simplify 2/(2+ square root of 3)
I need to convert this to a scientific notation 286,300,000,000.00
what is 28.09 rounded to the nearest tenthvis
Chemical transmitters can stimulate any receptor site to initiate an action.
what is 5,900 round to the nearest thousand
drew's weekly allowance is $8. His friend jan's weekly allowance is $10. Drew spends $3 a week and jan spends $4 a week. WRITE TWO EXPRESSIONS TO SHOW HOW MUCH
Approximately when did World War I occur? A. 1910s B. 1930s C. 1940s D. 1960s