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

A survey of 600 randomly selected employees in Company X found that 150 of them completed web analytics training. If there were 980 employees in the company, wh
Select the sentence in this passage that demonstrates the fallacy of oversimplification. The Civil War was the bloodiest conflict in the history of the Unit
WILL GIVE BRAINLESTWhy were the states which surrounded the USSR known as "satellite" states?
Earning $12.00 an hour; working 80 hours in 2 weeks. What is your pay?
The northern states wanted all foreign trade controlled by _____. the President the states the judiciary the Congress
Match each kind of drug to the effect it has on the brain. A. Steroid Dissolves the fatty tissue in the brain B. Inhalant Influences moods in the limbic system
What affects do you think gold mining had on the California
Janet is the one _____ likes to appear busy, but she just moves a lot of papers around. question 3 options: a.who b.whom
An atom of magnesium has an atomic number of 12 and a mass number of 24. how many neutrons are in the neclues
what navy took a role in yorktown