Ch 3 Debugging Flashcards

1
Q

good practices

A

Start small. Get something working and keep it working
Use print statements to debug lines of code. Rubber duck debugging (explain, out loud, what each line of your code does to an inanimate object).

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

NameError

A

Usually means that a variable has not been assigned a value yet. That is, you have used a variable before a value has been assigned to it

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

ParseError

A

Errors in the syntax of the program, so the interpreter cannot parse the python code. Such as “ print ‘this’ “ would result in a syntax error, the error being that the print function needs to have a proper header build, like this: print( ) . The string to be printed, “this”, should be inserted between the parentheses in the print() function, like this: print(“this”).

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

ValueError

A

Errors that occur when a function is expecting certain limitations on the values of its parameters and receives something outside of those limitations.

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