exceptions() occur when an expression cannot be executed correctly while the syntax is correct.
>>> x = 0 >>> y = 5/x
#5 cannot be divided by 0
Traceback (most recent call last): File "In order to avoid the annoying output, and prevent potential exceptions, let's try exception handling:
", line 1, in ZeroDivisionError: division by zero
>>> try: ... x=0 ... y=5/x ... except: ... print("Error") ...