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

You roll a 6 sided die. What is P(roll great her than 4)? If necessary round your answer to 2 decimal place
Pythagorean theorem ​
A news report says that 27% of high school students pack their lunch. Your high school has 600 students. How many students in your high school would you expect
isolation of a person who may be infected from people who are not infected
PLease evaluate this math problem for me!!
What phase of the product life cycle is the Moisturizing Black Soap Shampoo currently in?
*EASY* Will mark brainest!! Question: Determine whether the pair of lines is parallel, perpendicular or neither. x-8y=-5 y=8x-1
I accidentally left my sandwich on the dashboard of my car on a hot summer day. By the time I remembered the jelly had soaked into the bread rendering the whole
the team “renaissance” refers to a
Factor 1/7 out of 1/7x+1/17