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

Which of the following is an example of a GAAP standard? Ensuring financial statements are accurate and complete Ensuring products meet all quality standards
What was the government looking for in the Pacific?
Does the table below represent a function? Why or Why Not?
What are the three techniques scientists can use for correlation?
Design the software architecture for a student online registration system using the MVC architecture. Draw the architecture by specifying the role of controller
A. Name the smallest angle and the largest angle of the following triangles: F 6 S 5 1. A J 5.03 7 5 G B H 5.1 2. D 4 3 E​
Can a parabola have both a minimum and a maximum point? Explain.
3(5z-7) - 2 (9z-11) = 4 (8z-13) - 17
Which function is represented by the graph?
Which phrase best completes the diagram? Achievements of the maya civilization, Built huge pyramids, Created a decentralized government. A. got rid of slave