Question #360

What is the output of the code snippet below?
num1 = 100
num2 = 0
    result = num1/num2
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" . (

Comment on Disqus:

Question difficulty: πŸ”΅πŸ”΅πŸ”΅πŸ”΅πŸ”΅