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

A pumpkin is dropped, after 5 secs, its velocity is 47m/s. What is its acceleration?
By the time American troops entered world war l, the Allies
What proportion of scores lie below a score of 75
mas promessas sao falhas. no começo vai um mas ou mais?
What volume would 20.0g of CO2 occupy at a temperature of 298k and a pressure of 105 kPa​
Create a bullet-point list of how the United States and Soviet Union were alike during the Cold War? How were they different?
Answer ASAP Which two expressions are equivalent to 6 * V * W * 1/2 A. 1 * 3 * v * w + 0 B. 3(v + w) C. 3 * v * w D. w * v * 1/2 * 6 + 1 E. 2 * v * w * = multi
Where r the turning points of x^2(x-4)^7(x+3)^6
What is judicial review?In the Glorious Revolution of 1688, Parliament asserted its authority by offering leadership to
how can the percentage of plastic that is recycled be increased?