demo_try_except.py:
#The try block will generate an error, because x is not defined: try: print(x) except: print("An exception occurred")
➜ begtut>python demo_try_except.py
An exception occurred