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

Should school ban animal dissection?
QUESTION FOR 50 POINTS Solve this equation using an algebraic method: (x + 4)(x - 4) = 9 Choices are: x=5 x=4 and x=-4 x=9 x=5 and x=-5
Help me please thanks
Roy is a top executive at a cigarette manufacturing company who believes that cigarettes are dangerous products and they kill people. this condition can be desc
Why was the key rubbed with sadal paper in electroplating
20% of 60 plz explain
who ends up killing hector in Iliad Achillies Thetis Agamemnon Ajax
Dillon answered 80% of the questions on a quiz correctly. If he answered 40 questions correctly, what was the total number of questions on Dillon's quiz?
What type of rock is made from other types of rocks? A. Igneous B. Sedimentary C. Metamorphic D. Mineral
help plzzzzzzzzzzzzzzzzzzzzzzz