The quiz where the difficulty automagically adapts to the player's Python knowledge
This is a question page. You can use this page to bookmark a question. Start a new quiz!
Question #355
number = 28
for num in range(25, 30):
if number > num:
print(num)
else:
print(num)
break
Here, the Python control reaches line 4 three times and line 6 one time. During the iteration of the for loop in line 2, when values of num are 25, 26 and 27 (i.e. values smaller than 28), the control is reaching line 4 and when num is 28, it is reaching line 6 before breaking out from the loop. (w3schools.com/python/ref_func_range.asp)
Question difficulty: 🔵🔵🔵🔵🔵