charris47 charris47
  • 19-01-2021
  • Computers and Technology
contestada

What will the following program print when run?

for j in range(2):
for i in range(6, 4, -1):
print (i)

Respuesta :

epicmathmoment epicmathmoment
  • 19-01-2021

Answer:

6, 5, 6, 5

Explanation:

The first for means it will run twice. The second one will start at 6 and -1 until it gets to 4 where it will stop before doing anything. We say the first number IS inclusive and the second number ISN'T. The second one produces 6, 5 once but happens twice because of the first for.

Answer Link

Otras preguntas

All BUT one descriptive phrase applies to the illustration of water. That is
Limites del planisferio
explain why freedom of speech is important for the media
Which of the following was a response by the FCC to sensational media reporting on the airwaves? A. talk radio B. the Fairness Doctrine C. FM/AM radio D. th
The Heimlich maneuver, or abdominal thrust, should be used when someone is choking.
The volcanic landforms at divergent ocean plate boundaries are
Why is spot training a myth? a. Exercise only burns fat in specific body regions. b. Weight training strengthens muscles but does not burn fat. c. The result
How were slaves affected by the new republic?
7/20 as a percent use model if needed
How is the weight moving during the time period X=4 and X = 5?