Teacher's Guide
Chapter 3 / Level 4: Constants and Practice
Teaching Objective:
- Student learns what constants are and how they are used
- Familiarizes themselves with variable division
- Practices form and syntax with operators
Guide
Have the student use the constant egg_basket to store eggs in containers. Create two variables named bag1 and bag2 and store half the eggs in each bag using operators.
bag1 = egg_basket/2
bag2 = egg_basket/2
Walk to the three X marks in front of each container, face the containers and use the place() function to store them.
player.place(bag1)
........
player.place(bag2)
Walk to the next X mark in front of a table and use the speak() function to express the amount of eggs inside the egg_basket as detailed in the tutorial.
player.speak("there are %d eggs" % (egg_basket))
........
player.speak("there are %d eggs in bag 1 and %d in bag 2" % (bag1, bag2))
Map overview and path

Code Solution
import player
bag1 = egg_basket/2
bag2 = egg_basket/2
player.turn_left()
player.move_forward(3)
player.turn_left()
player.place(bag1)
player.turn_right()
player.move_forward(2)
player.turn_left()
player.place(bag2)
player.turn_right()
player.move_forward(2)
player.turn_left()
player.speak("there are %d eggs" % (egg_basket))
player.turn_right()
player.move_forward(3)
player.turn_left()
player.speak("there are %d eggs in bag 1 and %d in bag 2" % (bag1, bag2))