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

what do I do to figure out this problem:3x+8=26+x
name a metal that doesn't conduct electricity
I figured out the 1st question but I do not understand the second one...please show me step by step! Thank you!
Jim has gotten scores of 99 and 93 on his first two tests. what score must he get on his third test to keep an average of 90 or greater
Molecular scientists can read the DNA code and compare the DNA of different organisms. This concept is used in molecular clocks to determine which of the follow
what we need to become success
What is the highest mountain on each continent?
explain why the motion of a body which is moving with constant speed in a circular path is said to be accelerated ?
What's the other word stubborn; inflexible
which designer started as a fashion illustrator before focusing on industrial design?