Debugging Student Handout
 
Debugging with Karel - Student Handout

πŸ› DEBUGGING PYTHON ERRORS WITH KAREL

Date: Monday, October 7, 2025

Name: Period:

Bug Squad Team:

πŸ€” WARM-UP: Question of the Day

"How are Python error messages like a GPS when you get lost?"

My thoughts:

Partner's idea:

πŸ“š ACTIVITY 1: Error Types & Gestures

Learn the 5 Python Error Types:

Error Type Gesture What It Means
1. Syntax Error πŸ‘ Clap Code is "broken" - missing symbols, wrong punctuation
Notes:
2. Indentation Error ↔️ Step left/right Code is "misaligned" - wrong spacing at start of line
Notes:
3. Name Error 🀷 Point & shrug "Who's that?" - misspelled or undefined name
Notes:
4. Index Error πŸ™‹ Reach too far "Out of bounds" - accessing something that doesn't exist
Notes:
5. Logic Error πŸ”„ Turn in circle "Going in circles" - code runs but does wrong thing
Notes:

πŸ¦— BUG SQUAD CHALLENGE - Team Scorecard

Track your team's points during the movement challenge!

R1: ___ R2: ___ R3: ___ R4: ___ R5: ___ R6: ___ R7: ___ R8: ___ R9: ___ R10: ___

TOTAL POINTS: _______ / 10

πŸ› DEBUGGING WITH KAREL - PAGE 2

Name:

πŸŽ₯ ACTIVITY 2: Video Notes

Video: "Debugging with Error Messages" (CodeHS 1.14)

Key Ideas from the Video:

Most Important Thing I Learned:

πŸ‘₯ ACTIVITY 3: Partnership Debugging Practice

Partner Name:

My Role: Code Reader     Error Detective

CodeHS Exercise 1.14.3: Debug - The Two Towers

Errors we found and how we fixed them:
πŸ”§ PARTNER DEBUGGING HANDOUT

Work with your partner to find and fix these buggy Karel codes!

Problem 1:

move( turn_left() move()

Error Type:

What's wrong?

Fixed Code:

Problem 2:

def build_tower(): move() put_ball() move()

Error Type:

What's wrong?

Fixed Code:

Problem 3:

for i in range(5): move() put_ball() turn_left()

Error Type:

What's wrong?

Fixed Code:

πŸ› DEBUGGING WITH KAREL - PAGE 3

Name:

πŸ’» ACTIVITY 4: Independent Practice

CodeHS Exercise 1.14.7: Debug - Big Tower

Errors I found and how I fixed them:

My Debugging Strategy:

1. Read the error message carefully

2. Identify the error type

3. Locate the line number

4. Recall the gesture to remember the fix

5. Correct and test the code

🎫 EXIT TICKET: Debug - Random Hurdles

Complete on paper OR complete CodeHS Exercise 1.14.8 if time permits

Debug the code below. Karel should move forward, place a ball, and turn left.

def main(): move() put_bal() turn_left(

1. What error type(s) are in this code?

2. Explain what is wrong with the code:

3. Write the CORRECTED code below:

4. BONUS: Which gesture(s) would help you remember this fix?

πŸ’­ REFLECTION

What debugging strategy helped you most today?

On a scale of 1-5, how confident do you feel debugging Python errors?

☐ 1 (Not confident)    ☐ 2    ☐ 3    ☐ 4    ☐ 5 (Very confident)
Last updated  2025/10/02 11:33:39 PDTHits  47