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

identify the central I deal of the second paragraph of the selection
The ______________ of writing in the Middle East 8,000 years ago allowed people to keep permanent records.
Explain ways trees assist in keeping high water quality.
find f. f'(x)=sqrt x (3-10x) f(1)=9
The Ghost tells Horatio that Norway will soon attack Denmark. true or false
how much money does one really nice iPod cost black new. i am saving up on my money and so far i have $150 in my back pocket which ipod should i go with.
Determine the mass of a billion gold (u) atoms
What does a plant need for photosynthesis?
Put -9.3 and -4.125 and -2.25 in order from least to greatest
HURRRRRRRRRRRRRRRRRRRRRRRRRRRYYYYYYYYYYYYYYYYYYYYYYY TITLE II--INJUNCTIVE RELIEF AGAINST DISCRIMINATION IN PLACES OF PUBLIC ACCOMMODATION SEC. 201. (a) All pe