1/18
Looks like no tags are added yet.
Exception
An event that disrupts the normal flow of a program's instructions, causing an error or exceptional condition.
Catching exceptions
The process of handling an exception when it occurs, preventing the program from crashing.
Raising exceptions
The action of triggering an exception in a program, typically to indicate an error or unexpected situation.
Assertion
A statement that raises an AssertionError if a specified condition is not met.
KeyError
An exception raised when trying to access a non-existent key in a dictionary.
ValueError
An exception raised when a built-in operation or function receives an argument that has the right type but an inappropriate value.
TypeError
An exception raised when an operation or function is applied to an object of inappropriate type.
NameError
An exception raised when a local or global name is not found.
finally clause
A block of code that is guaranteed to execute after the try and except blocks, regardless of whether an exception occurred.
User-defined Exception
A custom exception created by deriving classes from built-in exception classes in Python.
Handling Unusual Situations
The practice of managing unexpected errors or exceptions that arise during program execution.
try...except block
A code structure in Python used to catch and handle exceptions, ensuring that the program can continue running.
Raising Exception To Caller
The process of propagating an error from a callee function back to the calling function.
ZeroDivisionError
An exception raised when an attempt is made to divide by zero.
Traceback
A report containing the function calls made in your code at a specific point, particularly during an exception.
Clean up operations
Tasks performed at the end of a program or method execution to ensure resources are properly released, often done in a finally block.
Exception Class
A base class for all exceptions in Python, from which built-in exceptions and custom exceptions are derived.
args property
An attribute of exception instances that contains the arguments passed to the exception; usually provides additional information about the error.
assert statement
A statement used to validate conditions in code, raising an AssertionError if the condition evaluates to false.