Students will be able to...
- Demonstrate their understanding of key concepts covered up to this point.
- Define and identify: debugging, syntax errors.
- Analyze and respond to error messages.
- 1.05 Slide Deck
- Download quiz and Answer key(access protected resources by clicking on "Additional Curriculum Materials" on the TEALS Dashboard)
- Associated Readings 1.3
- Take the quiz.
- After taking the quiz yourself, take a look at the answer key provided in the additional curriculum materials.
- Create a scoring rubric
- Look through debugging web tutorial to dig deeper yourself into analyzing and responding to errors.
Duration | Description |
---|---|
5 Minutes | Welcome and Review |
25 Minutes | Quiz |
25 Minutes | Debugging Activity |
- Ask students for any final questions before passing out the quiz.
-
Explain to students that you will now be exploring how to read analyze and respond to errors in code.
-
Ask students to read through it and predict what will be printed out.
favorite_number_str = input("What is your favorite number: ") birth_month_str = input("What month where you born in: ") lucky_number = int(favorite_number_str) + int(birth_month_str) print("Your lucky number is " + lucky_number)
-
Remind students that when reading through code we go line by line, as if we are the interpreter.
- Run the code, display the stack trace, and have students analyze the error message reported.
- Explain that debugging is the process of tracking. and fixing errors in your code.
- Indentation Errors: Errors the students are most likely to have seen
IndentationError: unindent does not match any outer indentation level
- Ask student why these errors are caused and how they find/fix this type of error? Suggest using the tab key to indent and the shift-tab to remove an indent as ways to avoid the error.
- Direct students to work through and complete this web tutorial on debugging.
Make sure to provide extended time on the quiz for any students who need extra time.