AtBS 10 Debugging Flashcards

1
Q

What is the message that is returned when there is an error in the code called?

A

Traceback message

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

How to gracefully handle an error and keep going with your program?

A

Use the traceback.format_exc() command

pg 218

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

What is a sanity check to make sure your code is not doing something obviously wrong?

A

an assertion

pg 219

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

What does an assert statement contain?

A

The assert key word

A condition that evaluates to TRUE or FALSE

A comma

A string to display when the condition evaluates to false

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

What are the levels of logging from least to most serious?

A

DEBUG

INFO

WARNING

ERROR

CRITICAL

pg 223

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

How to get debugger to finish the program?

A

Click “GO” to run the rest of the program

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

How to get debugger to run one line of code at a time?

A

Click “STEP” to run one line of the program at a time

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

How to set break points?

A

In the program file right click and select “Set Breakpoint”

Breakpoint line will highlight in yellow

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