Python Errors
Python Errors
Brandon Krakowsky
Python Errors
Common Error Types
Here are some common types of errors in Python
• SyntaxError: the syntax (or structure) of the code is incorrect
• IndentationError: the indentation (or spacing) of the code is in
• EOFError: end of file error, caused by reaching the end of an in
• AssertionError: assert statement fails, e.g., when asserting tha
equal to) another value in a unit testing method
• ValueError: a function receives an argument with an inapprop
• NameError: use of a variable or function name that is not valid
Ref:
• https://docs.python.org/3/tutorial/errors.html
• https://docs.python.org/3/library/exceptions.html
Common Error Types
Here are some common types of errors in Python
• TypeError: an operation or function is applied to a value with a
• IndexError: an index is out of range in a sequence, e.g., a list
• KeyError: a key is not found in a dictionary
• KeyboardInterrupt: execution of code is interrupted by the use
• MemoryError: an operation runs out of memory.
• ZeroDivisionError: division (or modulo operation) by zero
Ref:
• https://docs.python.org/3/tutorial/errors.html
• https://docs.python.org/3/library/exceptions.html