Python Errors
8 errors
Python runtime errors — SyntaxError, NameError, TypeError, IndentationError, and more.
8 / 8
- 1
SyntaxError: invalid syntax
Python can't parse your code — there's a missing colon, parenthesis, or wrong keyword somewhere on the reported line.
- 2
NameError: name 'x' is not defined
Python doesn't recognize the name you used — it was never assigned, imported, or defined in the current scope.
- 3
TypeError: unsupported operand type(s)
You used a value with an operator or function that doesn't accept that type — like adding a string to an integer.
- 4
IndentationError: expected an indented block
Python uses indentation to define code blocks — wrong, missing, or inconsistent indentation breaks the structure.
- 5
IndexError: list index out of range
You tried to access a list element at an index that is beyond the list's valid range (0 to `len(list) - 1`).
- 6
KeyError: 'x'
You tried to get a value from a dictionary using a key that isn't in the dictionary.
- 7
ModuleNotFoundError: No module named 'x'
Python can't find the module you're trying to import — it's not installed, not in the Python path, or the name is wrong.
- 8
AttributeError: 'x' object has no attribute 'y'
You tried to use a method or property on an object that doesn't have it — usually a typo or the wrong object type.
No errors found.