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

What political effects did literacy tests and poll taxes have in the “New South” after Reconstruction?
Explain what options the constitutional convention considered and the reason why
7. Which of the following best illustrates a pair of sentences that are joined by an understood relationship? A. Luke put three dollars into the office fo
What is the next letter BE GJ LO QT
At which income level does consumption equal income in table 9.1?
Veronica's mother learns that whenever she turns down the volume of her television, veronica finishes her homework quickly. this is an example of
P Is inversely proportional to v When p=5, v=8 Find a formula for p in terms of v
How to show a guy you like him
Write a balanced equation for the combination of magnesium and oxygen to form magnesium oxide, mgo. phase symbols are not graded.
The trees of mangrove forests live in shallow water, usually along shores of land masses....