Chapter 9: Exceptions, Errors, and Program Debugging Flashcards

1
Q

SyntaxError

A

The program contains invalid code that cannot be understood.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

IndentationError

A

The lines of the program are not properly indented.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

ValueError

A

An invalid value is used – can occur if giving letters to int().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

NameError

A

The program tries to use a variable that does not exist.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

TypeError

A

An operation uses incorrect types – can occur if adding an integer to a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

TypeError

A

An operation uses incorrect types – can occur if adding an integer to a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

try:

except:

A

Useful for debugging

Runs the try is there are no errors

Runs the except if there is an error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

EOFError

A

input() hits an end-of-file condition (EOF) without reading any input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

KeyError

A

A dictionary key is not found in the set of keys

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

ZeroDivisionError

A

Divide by zero error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

ValueError

A

Invalid value (Ex: Input mismatch)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

IndexError

A

Index out of bounds

How well did you know this?
1
Not at all
2
3
4
5
Perfectly