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

who fought in Queen Anne's war and what was the result
Decrease 175 Kg by 35%
a card is drawn at random from a standard 52-card deck find the probability that the card is not a 4 A) 1/13 B) 2/13 C) 11/13 D) 12/13 E) None
13. Trains used to be called iron mules by Native Americans. a. True b. False It’s false they hated the railroad and they called it “the iron Horses”
when and where was Gandhi bron​
True or False: A cause of the French and Indian War was that Britain and France fought for control of the land in the Ohio River Valley. They wanted the same la
what is the qoutient of 3/5 ÷ 1/10?​
Write a summary of “Born Free: Children Write a summary of “Born Free: Children and the Struggle for Human Rights.”and the Struggle for Human Rights.”
11. What is the server name? * A. WWW B. .net C. http
7. 3х + 3 = 3(х + 1)