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

The table below shows the numbers of tickets sold at a movie theater on Friday. NUMBER OF TICKETS SOLD Day Adult Tickets Children's Tickets 1,678 976 Friday Sat
What is the effect on the graph of the function f(x) = 2x when f(x) is replaced with f(2/3x)?A) vertical stretching B) vertical compression C) horizontal compre
4. Hightop Roofing was $3765 in the "red" (owed creditors this amount) at the end of June. At the end of December they were $8765 in the "red." Did they make or
The length of a rectangle is 1 cm less than three times the width. If the perimeter of the rectangle is 46 cm find the length and width of the rectangle
what is reciprocal of 6 and 13 ​
Pls do the question on the bottom of the page
Why did many exodusters come to great plains
What is the primary purpose of EHRs?
Explain the effect of C on the graph of Y=f(x) for the function y=f(x+c)
if x varies directly as y, find x when y=8. x=14 when y=-2