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 #802
j = 0
while j < 3:
print(j)
j += 1
else:
print(0)
Here, the else part of the code is executed when the condition of the while statement is False . (w3schools.com/python/python_while_loops.asp)
What is the output of the code snippet below?
— The Python Quiz (@thepythonquiz) May 3, 2021
j = 0
while j < 3:
print(j)
j += 1
else:
print(0)
0
1
2
0
0
1
2
0
1
2
3
0
It will throw a ValueError error.
π Comment the answer, like and retweet! #python
Question difficulty: π΅π΅π΅π΅π΅
Similar questions: