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 was one difference between the british and americans forces at the beginning of the american revolution
sixteen action figures are arranged equally on 2 shelves. How many action figures are on each shelf?Model the problem with both an array and a labeled tape diag
What percent of 150 is 9?
What are four physical properties of an orange.
One-third of a number, decreased by six equals eight. What is the number?
simplify using order of operations(PEMDAS):(2^3x6)-3^2
All living things break down _________ to make energy.
A football team lost 5 yards on each of 3 plays. Explain how you could use a number line to find the teams change in field position after the 3 plays.
What is the climax for Rikki Tikki Tavi
What's a word that means the opposite of shrieked?