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

PLEASE HELP I GIVE THANKS
How did the mountains in Greece contribute to the rise of city-states?
an explanation describe if a square-eyed pet mates with another square-eyed pet, can they have any round-eyed offspring.
does radiation need a phase of matter to travel with?
what is 15/24 in simplest form
EASY SCALE FACTOR SHOW WORK
How many times does four go into 153 ? What Is the remainder ?
a tabletop in the shape a trapezoid has an area of 6550 square centimeters its longer base measures 115 centimeters and the shorter base is 85 centimeters what
the area of a rectangular garden is 38 1/4 square meters. the width of the garden is 4 1/2 meters. find the length of the garden
what are 2 examples of ionic compound?