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

Hurrrry help me give me a experiment I can do at home that will be well conducted hellllp hurry answer
mama y papa cocinan juntos cual es el sujeto y el predicado
Select the correct answer Which phrase most closely matches the meaning of the word pleasantries in this excerpt from Susan Glaspelt's Trilles? COUNTY ATTORNE
A group of 120 students were asked how old they were when they lost their first tooth. 50% said they were 7 years old. How many students said they were 7 years
Which term describes molten rock beneath the earth's surface?
Why were early solar panels not popular
Which statement is true for this linear equation? 5x + 6 = 26 It has 2 constants, 1 coefficient, and 1 variable. It has 2 constants, 1 coefficient, and 2 variab
what is (9x-10y)-(-8x-8y)?
a number x is multiplied -1 1/10 the product is -1/2
Asher wants to compare the subjects of the poems "The Great Wave: Hokusai" and "Landscape with the Fall of Icarus" by analyzing their structures. Asher should p