- ASyntaxError
- BTypeError
- CValueError
- DNameError
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Input In [2], in() ----> 1 a = b NameError: name 'b' is not defined |
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Input In [1], in() ----> 1 a = int('hello') ValueError: invalid literal for int() with base 10: 'hello' |
Input In [3] a = {7) ^ SyntaxError: closing parenthesis ')' does not match opening parenthesis '{'
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Input In [4], in() ----> 1 a = 'Python' + 3 TypeError: can only concatenate str (not "int") to str |
--------------------------------------------------------------------------- ZeroDivisionError Traceback (most recent call last) Input In [63], in() 1 def abc(x): 2 return 20 / x ----> 3 print(abc(0)) Input In [63], in abc(x) 1 def abc(x): ----> 2 return 20 / x ZeroDivisionError: division by zero |
--------------------------------------------------------------------------- IndexError Traceback (most recent call last) Input In [66], in() 1 x = [1, 2, 3, 4] ----> 2 print(x[4]) IndexError: list index out of range |