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

Why do certain people – especially those in situations of adversity like Anna Cooper – succeed?
Block division how to solve 1723÷5
Has anyone read the short story Lamp to the Slaughter by Roald Dahl. If so, why did the author use the lamp to symbolize innocence? The baby to symbolize Patric
I’ll give you points and mark you BRAINLY has to be right!! Thank you for ur help
Raj is studying art at the local community college. He wants to take a stained glass art class that will count as 4 credits toward his degree. The college charg
Which speaker is most likely to make low-risk investments
Pls help me I’ll mark brainliest (English)
goodbyee points hi guys want some points here ill give it to you​
HELP!! I HAVE THE ANSWERS I Just NEED TO SHOW THE WORK!! What is the value of “y” in the diagram below? Answer: C
What is trivial? Please help it’s for english