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

rewrite the following sentence in the active or passive voice form 1. public elementary and secondary schools provide the free education to all people2. the you
A driver is 35 feet below sea level . After he swims up 10 feet toward the surface , what is his elevation
A 25 p⁺, 55 n⁰, 25 e⁻ B 25 p⁺, 30 n⁰, 25 e⁻ C 30 p⁺, 25 n⁰, 25 e⁻ D 25 p⁺, 30 n⁰, 23 e⁻
opinion writing about parents pick out the child clothes​
how do we find the area of the quadrilateral
Chromosome 11 is made of over million base pairs. Approximately how many genes are found on chromosome 11? List the genetic disorders found on chromosome 11. D
What is the cause of the effect many more new inventions are created as a result
The words assured, confident, conceited, and proud all have similar meanings. Which word would a writer use to express a negative opinion about a character? A.
What is the molecular geometry of the sulfate ion, SO42−? bent tetrahedral trigonal planar trigonal pyramidal
curtis needs 3 L of purple paint. Ratio of red to blue paint is 3:2. find the amt of red and blue paint he needs