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

Estimate the total weight of two boxes that weigh 9.4 and 62.6 pounds using rounding and compatible numbers. which estimate is closer to the actual total weight
What is determined by motion and the spacing of particles?
Angela can swim 1,700 meters in 40 minutes. What is Angela's unit rate
You purchase a total of 45 shares of stocks from 3 different companies. You purchase twice as many shares of company c stock as you do company a. Company a stoc
55/100 in simplest form?
how do you divide 3.4 divided by 12.92
(3x-4)∧2=8 how do i solve this
A 1/4 turn clockwise
solve this proportion: 1/c+5=2/3
Write an equation to model each situation thee solve ! The tallest player on the basketball team is 77 3/4 in. Tall. This is 9 1/2 in. Taller than the shortes