Exception Handling

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/15

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:07 PM on 9/23/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

16 Terms

1
New cards

exceptions

errors that occur during execution, usually caused in the environment where the code executes

2
New cards

ValueError

wrong value in specified data type

3
New cards

SyntaxError

violation of Python’s grammar rules

4
New cards

TypeError

two different types are combined

5
New cards

IndexError

index of a sequence doesn’t exist

6
New cards

KeyError

key doesn’t exist in dictionary

7
New cards

ZeroDivisionError

attempt to divide by zero

8
New cards

try

code that may cause errors

9
New cards

except

executes if exception occurs, skipped if not

10
New cards

else

executes if no exception occurs

11
New cards

finally

always executes regardless of exceptions

12
New cards

custom exceptions

defined by subclassing the built-in Exception class

13
New cards

exception chaining

allows you to link a newly raised exception to a previous one; use raise…from

14
New cards

exception groups

handles multiple exceptions simultaneously

15
New cards

context manager

allocates and releases resources precisely when needed

16
New cards

re-raising exceptions

allows you to catch an exception, perform some actions, and re-raise the exception