Python uses Exceptions to indicate errors. Each exception type indicates a particular type of error.


In [1]:
print x


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
/home/shkumar/python-workshop/<ipython-input-1-2d264e11d975> in <module>()
----> 1 print x

NameError: name 'x' is not defined

In [2]:
blah blah


  File "<ipython-input-2-6a5fb9ebd6c8>", line 1
    blah blah
            ^
SyntaxError: invalid syntax

In [3]:
x+y))


  File "<ipython-input-3-146342f5f4ee>", line 1
    x+y))
       ^
SyntaxError: invalid syntax