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

If you determine that a patient is in need of CPR, what should be your first response?A. begin cardiac compressionsB. run for helpC. begin mouth to mouthD. call
Lisa, a network manager, has been assigned to a new team. She organizes a meeting to understand the strengths and talents of the team members. Which quality is
How do i Evaluate (5)(6+1-3)
A vendor at a fair ties her tent to a rock-filled coffee can in order to hold the rope down. The can, including the rocks, has a mass of 2.5 kg. A stiff breeze
Based on the passage above, which of the following is an opposing claim? A. Delia does not have experience with taking care of young children. B. Delia is v
The summerians were known for many advances. Name some here
Start time: 9:38 pm End time: 1:16 am
How many solutions does the system of equations below have? 2x + y = 3 8x + 4y = –11
which food is the temperature danger zone tdz
−3s2+4s​−4 give the function