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 #360
num1 = 100
num2 = 0
try:
result = num1/num2
print(result)
except ZeroDivisionError:
print("A division by zero error occured")
On line 4, a division by 0 happens as num2 = 0 . This results in a ZeroDivisionError exception taking control to line 7 which prints "A division by zero error occured" . (w3schools.com/python/python_try_except.asp)
Question difficulty: 🔵🔵🔵🔵🔵