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