TypeErrorTypeError
An operation or function was applied to an object of an inappropriate type.
What causes this error
You performed an operation on incompatible types, such as adding a string to an integer, calling a non-callable object, passing wrong argument types, or using an object that does not support the required protocol (iteration, indexing, etc.).
How to fix it
Check the types of your variables with type(). Convert types explicitly: str(), int(), float(), list(). Use isinstance() for type checking. Read the error message carefully; it usually tells you exactly which types are incompatible.
Example
"hello" + 5 # TypeError: can only concatenate str to strRelated Error Codes
IndentationErrorIndentationError
The code has incorrect indentation, which is syntactically significant in Python.
KeyboardInterruptKeyboardInterrupt
The user pressed Ctrl+C to interrupt the running program.
re.errorre.error: Invalid regular expression
The regular expression pattern contains invalid syntax.
LookupErrorLookupError
Base class for errors raised when a key or index is not found (KeyError, IndexError).
NameErrorNameError: name is not defined
A local or global name was referenced that has not been defined.
FileExistsErrorFileExistsError
An operation failed because the file or directory already exists.