Introduction to Programming - Error Handling and Debugging

0.0(0)
studied byStudied by 0 people
0.0(0)
linked notesView linked note
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/20

flashcard set

Earn XP

Description and Tags

Flashcards for key concepts in error handling and debugging in Python programming.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

21 Terms

1
New cards

Exception Handling

The method of controlling unwanted or unexpected events that occur during program execution to prevent crashes.

2
New cards

Try Block

Code section that could potentially raise an exception.

3
New cards

Except Block

Code section that handles an exception raised in the try block.

4
New cards

Syntax Error

An error due to incorrect format in a Python statement, detected during translation to machine language.

5
New cards

Runtime Error

An error that occurs during the execution of a program, putting it in an erroneous state.

6
New cards

Assertion

A sanity check in code that raises an AssertionError if a condition is false.

7
New cards

ValueError

Occurs when a function receives an argument of the right type but inappropriate value.

8
New cards

FileNotFoundError

Raised when an attempt to open a file fails because the file does not exist.

9
New cards

ZeroDivisionError

Occurs when a program attempts to divide a number by zero.

10
New cards

Nested Try/Except

Having try/except blocks inside other try/except blocks to handle exceptions in layers.

11
New cards

Error Chaining

A mechanism that allows one error to be affected by another, providing context for the additional exception.

12
New cards

User-Defined Exception

Custom exceptions created by programmers for specific error conditions.

13
New cards

Debugging

The process of identifying and resolving bugs within software programs.

14
New cards

Testing and Validation

Ensuring that the program behaves as expected by comparing outputs against specifications.

15
New cards

Logic Error

A mistake in the program's logic that results in incorrect behavior, often hard to debug.

16
New cards

Black Box Testing

Testing based on analysis of the specification rather than the code.

17
New cards

White Box Testing

Testing based on knowledge of the internal logic of the application's code.

18
New cards

Exception Hierarchy

The structure of exceptions in Python, defining how exceptions relate to one another.

19
New cards

Finally Block

Code that will always be executed at the end of a try/except structure, regardless of an exception.

20
New cards

Debugging Steps

A systematic approach to identifying and fixing bugs, including studying code and examining state.

21
New cards

Intuition in Programming

Using an instinctive understanding of the problem space to develop algorithms and understand bugs.