>>> a
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'a' is not defined
>>> try:
...   a 
... except:
...   print("'a' is not defined.")
... 
'a' is not defined.