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

Explain 2 different ways to find the greatest common factor of 15x2y3  and 24x4y2 .
solve the formula for the indicated variable (b=rw+r,for w  sollution w=____)
solve the formula for the indicated variable  c=yt+y,for t (the solution is t=___)
genes are carried from parents to offspring on structures called
katherine spends 1,089.72 each month for rent and supplies to run her salon. If she charges $18 for a haircut how many hair cuts must kathrine do to cover her e
Given the volume of a cube is 8 cubic meters, find the distance from any vertex to the center point inside the cube. (A) 1 m (B) √2 m (C) 2√2 m (D) 2√3 m (E) √3
if a baking tray is 700mm by 600mm, how many of 25cm in diameter can fit into the baking tray?
What is nth term for 0 6 24 54 96?
how do you convert mol dm-3 to gdm-3 and vice versa
katherine spends 1,089.72 each month for rent and supplies to run her salon. If she charges $18 for a haircut how many hair cuts must kathrine do to cover her e