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

A softball manager has 10 players on the same ability. how many nine players starting lineups can he create?
Narrative Techniques and Structure - Part 1 How does the point of view shape what the reader learns from the narrative? A: It lets the reader share the exciteme
what is 11/21 as a decimal rounded to a 3 decimal places?
Find the product. - 5y4 (5y2 + 4y -2)
PLEASE HELP ME IM GIVING 35 POINTS i literally don't know what i'm supposed to do
25^2/5 using the root symbol
Can you do pls help me
A car with an initial speed of 23.4 km/h accelerates at a uniform rate of 0.90 m/s2 for 4.0 s. Find the final speed of the car. Answer in units of m/s. Find the
Stuck on this question. Please Help!
Where can we find happiness according to Aristotle? Please don't copy off the internet it will go through a checker.