Teaching Tip: Emphasize that functions must be defined before they are called. This is a common error for beginning programmers.
2
Big Tower
3 Errors
Error #1Line 6
⚠️ LOGIC ERROR: Incorrect Condition
What's Wrong: The condition while facing_north(): should be while not_facing_north():
✅ How to Fix:
while facing_north():while not_facing_north():
Why: Karel should keep turning left UNTIL facing north, not WHILE already facing north.
Teaching Tip: This is a logic error that won't produce an error message but will cause incorrect behavior. Have students trace through what happens with the wrong condition.
Error #2Line 13
⚠️ LOGIC ERROR: Duplicate Action
What's Wrong: There is an extra put_ball() inside the while loop
✅ How to Fix:
Remove the duplicate put_ball() statement. The correct structure should be:
while front_is_clear():
put_ball()
move()
put_ball()while front_is_clear():
put_ball()
move()
Why: This causes Karel to place two balls per square, which is incorrect.
Error #3Line 17
⚠️ SYNTAX ERROR: Missing Underscore
Error Message: NameError: name 'buildtower' is not defined
What's Wrong: Function name is buildtower() but should be build_tower()
✅ How to Fix:
buildtower()build_tower()
Teaching Tip: Function names must match EXACTLY, including underscores. Python is case-sensitive and space-sensitive.
3
Random Hurdles
5 Errors
Error #1Line 8
⚠️ SYNTAX ERROR: Colon Instead of Parenthesis
Error Message: SyntaxError: invalid syntax
What's Wrong:turn_right(): should be turn_right() (no colon)
✅ How to Fix:
turn_right(): turn_right()
Why: Colons are only used after function definitions, loops, and conditionals, not when calling functions.