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

________ are more likely than any other age group to volunteer more than 100 hours annually.
please help me with this
Magnesium phosphate reacts with sulfuric acid to form magnesium sulfate and phosphoric acid. what is the coefficient for sulfuric acid when the equation is bala
Steven works at a large home appliance store. He earns a base salary of $20,000 plus commission which can be modeled by the equation y = 0.1x + 20,000. What is
The Earth's crustal plates move due to _____ currents. convention condensation convection collaboration
​what would you tell your female friend who is 15 pounds above her ideal weight and who has asked you for advic
Solve by graphing y = -3 y = 6x - 3
the easiest form to work with when finding the slope of a line
Print cite this famed act of american colonial defiance served as a protest against taxation. seeking to boost the troubled east india company, british parliame
¿Qué hora es? Son las dos y treinta y cinco de la tarde