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 did Americans support war at home
is it true that fiber is digestable
How to substitute equations
In rectangle ABCD, AD=6 and AB=8. What is the measure of diagonal AC
which choices are real numbers? A- (-531441) 1/12 B- (-131072) 1/16 C- (-256) 1/11 D- (-5776) 1/7
Which sentence illustrates parallel structure? The students read the instructions, were discussing how complicated they seemed, and the unanimous decision was
Anexploreriscapturedbyagroupofcannibals.thereare two types of cannibals—those who always tell the truth and those who always lie. the cannibals will barbecue th
In lines 7-8 what does Quindlen mean whe she describes America as being like the crazy quilts that have been one of its great folk-art forms?
The study of passing traits from parents to offspring is known as
Write three sample research questions about the sinking of USS Maine.