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

how does the culture of UK influence the rest of the world
Which is an important element in an idea map? 1. Bibliography 2.Lines connecting ideas 3.List of sources 4.Paragraph
Write a real-world problem to represent 7x-18 < 32
The shedding of the lining of the uterus every other month is known as menstruation
What is 18 9/11 - 8 3/8 ??
Write a real-world problem to represent 7x-18 < 32
What is the gcf for 36, 54 and 135?
what is z^(3)+5z+3z^(2)+1 - 4 - 2z^(2) simplified
Please Help!! Which sentence is grammatically correct? Question 9 options: Nosotros leen muchos libros. Ustedes leen muchos libros. Yo lee muchos libros. Tú l
janelle has 3.6 yards of wire, whice she wants to use to make bracelets. she needs 0.3 yard for each bracelet. altogether, how many bracelets can janelle make?