0% found this document useful (0 votes)
50 views5 pages

JUPALLI - CHINMAYANANDHA Batch No 191

The document defines and describes various types of errors that can occur in Python programs. It provides descriptions of common error types like Exception, StopIteration, SystemExit, StandardError, ArithmeticError, OverflowError, FloatingPointError, ZeroDivisionError, AssertionError, AttributeError, EOFError, ImportError, KeyError, IndexError, NameError, UnboundLocalError, EnvironmentError, IOError, OSError, SyntaxError, IndentationError, SystemError, TypeError, ValueError, RuntimeError, and NotImplementedError. Each error is concisely defined in 1-2 sentences.

Uploaded by

S MAHENDIRAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views5 pages

JUPALLI - CHINMAYANANDHA Batch No 191

The document defines and describes various types of errors that can occur in Python programs. It provides descriptions of common error types like Exception, StopIteration, SystemExit, StandardError, ArithmeticError, OverflowError, FloatingPointError, ZeroDivisionError, AssertionError, AttributeError, EOFError, ImportError, KeyError, IndexError, NameError, UnboundLocalError, EnvironmentError, IOError, OSError, SyntaxError, IndentationError, SystemError, TypeError, ValueError, RuntimeError, and NotImplementedError. Each error is concisely defined in 1-2 sentences.

Uploaded by

S MAHENDIRAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

EXCEPTION ERROR

*An exception is an event, which occurs during the execution of a program


that disrupts the normal flow of the program's instructions.
In general, when a Python script encounters a situation that it cannot cope with,
it raises an exception. An exception is a Python object that
represents an error.

2. STOPITERATION

*StopIteration is a statement that will be useful when you want to stop the
iteration at state to prevent the iteration
from going over and over.

3. SYSTEM EXIT

*The SystemExit exception is inherited from this BaseException instead of


Exception or StandardError as it is not any technical error,
so it can be caught by the code that catches the exception. So when this
exception is raised, and it cannot be handled,
then the Python interpreter exits.

4. STANDARDERROR

*The standard error of the mean is a way to measure how spread out values are
in a dataset.
It is calculated as: Standard error of the mean = s / √n. where: s: sample
standard deviation.

5. ARITHMETIC ERROR

*ArithmeticError is thrown when an error occurs while performing mathematical


operations. These errors include attempting to perform
a bitshift by a negative amount, and any call to intdiv() that would result in a
value outside the possible bounds of an int.

6. OVERFLOW ERROR

*In general, a data type overflow error is when the data type used to store
data was not large enough to hold the data. Furthermore,
some data types can only store numbers up to a certain size. An overflow error
will be produced, for example, if a data type is a single byte
and the data to be stored is greater than 256.

7. FLOATING POINT ERROR

*It's a problem caused when the internal representation of floating-point


numbers, which uses a fixed number of binary digits to represent
a decimal number. It is difficult to represent some decimal number in binary, so
in many cases, it leads to small roundoff errors.

8. ZERO DIVISION ERROR


* A ZeroDivisionError occurs in Python when a number is attempted to be
divided by zero. Since division
by zero is not allowed in mathematics, attempting this in Python code raises a
ZeroDivisionError

9. ASSERTION ERROR

* An AssertionError Python is returned when the assertion expression is


false. In Python BaseException class is the base of
all the exception classes. AssertionError's base class is the Exception class
which inherits from the BaseException class.

10. ATTRIBUTE ERROR

* AttributeError can be defined as an error that is raised when an attribute


reference or assignment fails. For example, if we take
a variable x we are assigned a value of 10. In this process suppose we want to
append another value to that variable. It's not possible.

11. EOF ERROR

* EOFError is short for "End-of-Line Error." This error occurs when Python has
reached the end of user input without receiving any input.
The reason that EOFError occurs is that Python attempts to print out your input
in variable string when no data is given.

12. IMPORT ERROR

* This error generally occurs when a class cannot be imported due to one of
the following reasons: The imported class is in a circular dependency.
The imported class is unavailable or was not created. The imported class name is
misspelled.

13. KEYBOARD INTERREPT

* The interpreter throws a KeyboardInterrupt exception when the


user/programmer presses the ctrl – c or del key either accidentally or
intentionally.
Syntax: As observed in the example above, the KeyboardInterrupt exception is a
standard exception used to handle keyboard-related issues.

14. LOOKUP ERROR

* The LookupError exception in Python forms the base class for all exceptions
that are raised when an index or a key is not found for a sequence or
dictionary respectively. You can use LookupError exception class to handle both
IndexError and KeyError exception classes.

15. INDEX ERROR

* IndexError is an exception in python that occurs when we try to access an


element from a list or tuple from an index that is not present in the list.
For example, we have a list of 10 elements, the index is from 0 to 9.

16. KEYERROR

* KeyError in Python is raised when you attempt to access a key that is not in
a dictionary. The mapping logic is a
data structure that maps one set of data to significant others. Hence, it is an
error, which is raised when the mapping is accessed and not found.

17. NAMEERROR

* In Python, the NameError occurs when you try to use a variable, function, or
module that doesn't exist or wasn't used in a valid way.
Some of the common mistakes that cause this error are: Using a variable or
function name that is yet to be defined.

18.UNBOUNDLOCALERROR

* An UnboundLocalError can occur due to two reasons in Python, one is when you
are trying
to access the value of a variable before it is assigned, and the second is when
Python fails to differentiate between global and local variables.

19.ENVIRONMENTERROR

* EnvironmentError is the base class for errors that come from outside of
Python (the operating system, file system, etc.).
It is the parent class for IOError and OSError exceptions.

20.IOERROR

* IOError in Python is a result of incorrect file name or location. This error


is raised in multiple conditions and
all these conditions can be handled using try except code block.

21.OSERROR

* OSError is a built-in exception that serves as an error class for the


functions present in the os module.
It is raised when the os specific system function returns a system-related or
I/O error. The OSError exception has two constructors.

22.SYNTAXERROR

* Syntax error occurs when the interpreter shows invalid syntax on executing
the Python code. A syntax error occurs due to missed reserved keywords, spaces,
quotes placed improperly, indentations and incorrect usage of blocks, invalid
declarations, and if the function calls and definitions aren't done properly.

23.INDENTATIONERROR
* The indentation error can occur when the spaces or tabs are not placed
properly. There will not be an issue if the interpreter does not find
any issues with the spaces or tabs. If there is an error due to indentation, it
will come in between the execution and can be a show stopper.

24.SYSTEMERROR

* The SystemError is raised when the interpreter finds an internal error. The
associated value is a string indicating what went wrong.
The SystemExit is raised when sys. exit() function is called.

25.TYPEERROR

* Typeerror occurs when you use different data types in an operation. For
example, if you attempt to divide an integer (number) by a string,
it leads to a typeerror because an integer data type is not the same as a
string.

26.VALURERROR

* ValueError occurs when a correct argument type but an incorrect value is


supplied to a function. This type of inaccuracy is most common in mathematical
operations.
A TypeError, as opposed to a ValueError, is raised when an operation is
performed that is using an incorrect or unsupported object type.

27.RUNTIMEERROR

*A runtime error is a type of error that occurs during program execution. The
Python interpreter executes a script if it is syntactically correct.

28.NOTIMPLMENTEDERROR

*In Python, NotImplementedError is a special type of exception raised when an


abstract method of a class is called but has not been implemented by any of its
subclasses

You might also like