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 do u guy do this
Summer plans. Complete the following sentences with the future tense of the verbs in parentheses.
Which of the following is a basic point that Keynes made about consumption? Question 5 options: Consumption and disposal income are inversely related. When disp
How do heart rate and cellular respiration relate to each other?
I need to find the value of x. Can you help please!?!?​
When you perform a stoichiometry calculation, you are determining the ... A) actual yield B) theoretical yield C) percent yield
Containment was a Cold War policy designed to prevent the spread of
find the area of each circle round to the nearest tenth use 20 yard
The admission at the movies is $5 for children and $10 for adults. The total amount collected was $3,000.00. There was a total of 500 people. Create a system of
help meeeeeeeeeeeeeeeeeeeeeeeeee