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 are people made in the world? and How are children made in the world different?
Find the slope of the line. - 3x – 2y = 7
Consider this Expression.​
Select all the correct answers. A farmer planted broccoli during winter. Which crops should he plant now especially after three months of frost? 1 tomatoes 2 ar
including the end zone a football field measure 120 yds long by 53 1/3 yards wide. what is the area of the football field ?
a school playground is rectangular and has a length of 50 m and a width of 30m as shown. A safety zone of uniform width surrounds the playground. If the area of
I'm confused. Can you plz answer the underlined question.
why are rivers and oceans seen as barriers
A teacher must grade 32 reports. She can grade 4 reports in 90 minutes. How many hours will it take to grade 32 reports?
In the right triangle below, an altitude is drawn to the hypotenuse. Solve for x. Can someone please explain this step by step?