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

6. Which expression is equivalent to 4x +3 - 3x + (-2)?SHOW WORK
If you have a mutation that is to your advantage, what could be the result?
Determine which of the statements below are accurate regarding how a petty cash fund is created and used in a business. (Check all that apply.) A. When the fun
A new fitness center had 350 members in its first year. The number of members increased by 14% each year thereafter. Find the approximate number of members afte
What is the number of moles in 40.0 L of He gas at STP?
Write in the process used to separate each mixtureMixtureProcesssalt + watersugar + waterrice + pasta shapessand + waterfour + ricepaperclips + sawdust​
Discuss two ways in which some cultural views that exist may affect a relationship negatively
5. What is the volume of the rectangular prism? 3 160 12 volume units exponent
Sally has constructed a concentration cell to measure Ksp for MCln. She constructs the cell by adding 2 mL of 0.05 M M(NO3)n to one compartment of the microwell
please solve this root under x-2=cube root under 125