Errors and Exceptions handling

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/16

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

17 Terms

1
New cards

Error

A problem in a program that stops it from completing its task.

2
New cards

Exception

A condition that disrupts the normal execution of the program.

3
New cards

try Block

Tests a block of code for errors.

4
New cards

except Block

Handles the error.

5
New cards

else Block

Executes code when there is no error.

6
New cards

finally Block

Executes code, regardless of the result of the try and except blocks.

7
New cards

raise Keyword

Used to raise an Exception.

8
New cards

Syntax Error

Syntax mistake in the code, such as a missing colon or unmatched parenthesis.

9
New cards

Indentation Error

The code is not properly indented.

10
New cards

Name Error

A local or global name is not found, usually occurs when using an unidentified variable

11
New cards

Value Error

A function receives an argument of the correct type but an inappropriate value.

12
New cards

Index Error

Trying to access an index that is out of range for a list, tuple, or string.

13
New cards

Key Error

Trying to access a dictionary key that does not exist.

14
New cards

Attribute Error

An invalid attribute reference or assignment is made / attempting to call a nonexistent method on an object.

15
New cards

Import Error

An import statement has issues, such as importing a non-existent module or function.

16
New cards

ZeroDivisionError

Trying to divide by zero.

17
New cards

File Not Found Error

A file or directory is requested but cannot be found.