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

he worked ---- and was promoted in two years a) hardly b) diligentlyc) lethargically d) lazily
Velma must make five bottles of lemonade for the kids playing outside each bottle requires 3/4 cup of sugar how much sugar does she need?
Radiation is an example of a transverse wave t or f
Do you have to do the course evaluations after the exams on penn foster ?
Explain how you can find the amount of money Juan save if he earned $12 walking dogs
(1 point) Jump to Question: What condition occurs when the median nerve in the wrist is compressed?
consider the lines described by the equation y-5=m(x-2), where m can be any real number. How many lines are described by this equation?
Dilation of a line by a scale factor 1/3 centered at the point (4,2)
The second multiple choice question has C.39 or D.49
seven hundreds five tens and six ones