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

written in simplest form, the expression (x^2)(y^2)-9 over 3-xy is equivalent to 1. -1 2. 1 over 3+xy 3. -(3+xy) 4. 3+xy Please show work
A shop is giving 20% discount in a sale. A shirt in the shop normally costs $60. How much does it cost in the sale?
why are quebec and ontario known as canadas economic heart
why did some chiefs decide to fight when english colonists moved into their territory?plz help me
Polished metals have a metallic luster, which means that?
why are quebec and ontario known as canadas economic heart
how can you tell the difference between additive comparison and multiplication comparison
how did the experience of the early colonists shape Americas political and social ideals?
How do u do this problem: W/6+5/8=-1 3/8 I got this answer: -1 53/64
plz help me solve this question how many remain when 87 is divided by 9