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 role did religion play in Maya life?
What is the prepositional phrase in the sentence below? I have always wanted to run barefoot on the beach and feel the soft sand beneath my feet. :on the beach:
How did economic imperialism lead to India’s becoming a British colony?
What was the connection between anti-Semitism and Zionism?
What was the most important achievement of Pope Gregory I?
Who was Benjamin Franklin?
Why was Kush able to thrive after losing Egypt to the Assyrians?
What is the difference between de facto and de jure segregation? Which does the policy of bussing attempt to solve?
How does historical globalization affect us today?
What methods do terrorists employ?