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

are volcanoes appart of plate tectonics
What was one reason Congress gave for wanting to remove President Johnson from office?
Match each element with the number of atoms found in one molecule of this compound: C5H7N (nicotine)
In 1783 Antoine Lavoisier showed that the heat produced by respiration was comparable to the heat produced when charcoal was burned. This experiment shows the s
what does say I can or say I can't and you are right either way mean
calculate the loss on selling 50 shares of stock originally bought as 13 3/4 and sold at 12
Because Canada is a Constitutional Monarchy, its symbolic head of state is
how many inches are in 4 miles
What is a pathogen is?
PLEASE ANSWER ASAP! MUST BE CORRECT TO RECEIVE POINTS & THE BRAINLIEST ANSWER!!! In the Odyssey, why doesn't Odysseus immediately reveal his true identity t