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

An observer measures the angle from the ground to the top of a building from two different locations, The measurements are shown on the diagram. What is angle A
10) What is the energy of a photon whose frequency is 2.7 X 1014 Hz? A) 2.45x10-20) B) 2.45x1048) C) 17.9x10-20 D) 17.9x1048)
It takes 108 pounds of seed to completely plant a 12 -acre field. How many pounds of seed are needed per acre?
HELP PLEASE BE QUICK
What is dialect in a story?
What is the area of a circle with a radius of 5 ft? Use 3.14 for pi. A 10\piπ sq. feet B 25\piπ sq. feet C 31.4 sq. feet D 78.5 sq. feet
Which type of graph would best display data in a frequency table? A. pie graph B. histogram C. pictograph D. line graph
A compound contains 21.6% Na, 33.3% Cl, and 45.1% O. Write the empirical formula and name the compound that is formed
Why were the Dixiecrats created?? Picture below⬇⬇ 20pts.!!!!
Night Shades Inc. (NSI) manufactures biotech sunglasses. The variable materials cost is $15.60 per unit, and the variable labor cost is $5.70 per unit. a. What