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

solve the inequality 4(n-3)- 6 > 18
The code of chivalry is BEST exemplified by A. Arthur's pledge to stand for true justice. B. Merlin's prophecy for the future of England. C. the litany of c
Synonyms: Match the word with the word or phrase nearest to its definition. bipartisan A. divided into two equal parts B. involving two political part
What is the geometric mean of 9 and 16
What caused the Tulsa race riots
A used bookstore will trade 2 of its books for 3 of yours. If Val brings in 18 books to trade, How many books can she get from the store?
What is the authors purpose in writing the article The Aqua-Lung-Bringing Ocean Exploration to New Depths
How does the shape of orchids relate to gene expression?
Can someone give me the answer
I need help please!!!