HenryLez HenryLez
  • 06-11-2020
  • Computers and Technology
contestada

Review how to write a for loop by choosing the output of this short program.

for counter in range(3):
print(counter * 2)

2
3
4


0
2
4


0
1
2


2
4
6

Respuesta :

Cytokine
Cytokine Cytokine
  • 06-11-2020

This for loop will output:

0

2

4

The range(3) is all the integers between 0 inclusive and 3 exclusive. 0, 1, 2.

Every iterations through the for loop, we multiply the value of each number by 2 and print it to the console.

0 * 2 = 0

1 * 2 = 2

2 * 2 = 4

I hope this helps.

Answer Link
starwars920jack
starwars920jack starwars920jack
  • 13-01-2021

Answer:

The answer is 0 2 4. I hope this helps you out. Have a wonderful day and stay safe.

Explanation:

Answer Link

Otras preguntas

Which literary device is most likely to be present in a short pastoral poem? suspense personification foreshadowing flashback
Besides creating jobs, what did President Johnson believe was the key to ending poverty?
solve problem 4/15 = x/ 75
The largest social class in Egypt or ancient Rome was made up of
Solve the system using any algebraic method. Show all your steps. 19. 2x-5y=3 -4x+10y= -6 20. 8x+3y=10 -6x + y = -12
if Hayden had 1224 golden apples and jenny had 1889 golden apple how many would the have all together
which of the boys is the understood leader? how do you know this? in the book holes.
how to determine whether the equation defines y as a function of x. is it a function yes or no to the problem: x=y^2-6 and problem y=x^2+6
find the sum write your answer in simplest form  7/10 - 1/2
Can anyone help??? simplify: cos(126°)cos(36°) + sin(126°)sin(36°)