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

What happens to thermal energy from the sun as a result of the greenhouse effect?
The Cape Fear River basin is the largest in North Carolina. Which statement BEST describes a river basin? A) River basins are tributaries that drain into a muc
What are the pros and cons of using the internet in the medical office setting?
I need help filling in the blanks in the vocab check for math
how many boxes are needed for 66, 72 and 84 cups?
Which sentence in this excerpt from Ambrose Bierce's "An Occurrence at Owl Creek Bridge" uses personification? Excepting the group of four at the center of the
Who won the Six Day War? A. Syria, Jordan, and Egypt B. Saudi Arabia C. Israel D. Iran
the perfect squares between 50 and 104
Which reaction occurs at the anode during the electrolysis of aqueous NaCl solution using inert electrodes? Hydrogen is released at the positive anode. Chlorine
List the three methods that people have used to develop organisms with desirable traits.