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

Why equals 2X plus 7Y equals 5X +4 graph the answer
A modern seismograph consists of
Explain the differences between shade, shading, and shadow.
What is your mano is attached to? pierna brazo cabeza
Marco and Elaine are building a stand like the one shown to display trophies.
Use the words capacity and regulation in 1 sentence
Northern Switzerland has a fairly cold climate caused by sea winds from the Atlantic Ocean, but southern Switzerland tends to be much warmer and sunnier. What
Which words in the sentence are the adverb clause? even though i'm moving to another state, can we remain best friends?
How long is the great wall of china in feet?
What is the most important change the internet and social media has brought to sharing information? a. average citizens are given a voice and can interact with