Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def divide_two_numbers(x, y):
- result = x / y
- return result
- try:
- result = divide_two_numbers(2,0)
- print(result)
- except NameError:
- print("A NameError occurred.")
- except ValueError:
- print("A ValueError occurred.")
- except ZeroDivisionError:
- print("A ZeroDivisionError occurred.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement