1/20
Flashcards for key concepts in error handling and debugging in Python programming.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Exception Handling
The method of controlling unwanted or unexpected events that occur during program execution to prevent crashes.
Try Block
Code section that could potentially raise an exception.
Except Block
Code section that handles an exception raised in the try block.
Syntax Error
An error due to incorrect format in a Python statement, detected during translation to machine language.
Runtime Error
An error that occurs during the execution of a program, putting it in an erroneous state.
Assertion
A sanity check in code that raises an AssertionError if a condition is false.
ValueError
Occurs when a function receives an argument of the right type but inappropriate value.
FileNotFoundError
Raised when an attempt to open a file fails because the file does not exist.
ZeroDivisionError
Occurs when a program attempts to divide a number by zero.
Nested Try/Except
Having try/except blocks inside other try/except blocks to handle exceptions in layers.
Error Chaining
A mechanism that allows one error to be affected by another, providing context for the additional exception.
User-Defined Exception
Custom exceptions created by programmers for specific error conditions.
Debugging
The process of identifying and resolving bugs within software programs.
Testing and Validation
Ensuring that the program behaves as expected by comparing outputs against specifications.
Logic Error
A mistake in the program's logic that results in incorrect behavior, often hard to debug.
Black Box Testing
Testing based on analysis of the specification rather than the code.
White Box Testing
Testing based on knowledge of the internal logic of the application's code.
Exception Hierarchy
The structure of exceptions in Python, defining how exceptions relate to one another.
Finally Block
Code that will always be executed at the end of a try/except structure, regardless of an exception.
Debugging Steps
A systematic approach to identifying and fixing bugs, including studying code and examining state.
Intuition in Programming
Using an instinctive understanding of the problem space to develop algorithms and understand bugs.