Please send questions to
st10@humboldt.edu .
#---------------------------------------------------------
# Module name: lect10_4.py
# part 3: using a dict to implement a
# multiway branch, and dict's get method
# to include a "default" action
# By: Sharon M. Tuttle
# last modified: 10-26-05
#---------------------------------------------------------
price_branch = {'spam' : 1.25,
'ham' : 1.99,
'eggs' : 0.99,
'bacon': 1.10 }
for ct in range(0, 5):
choice = raw_input("What's to eat? ")
print price_branch.get(choice, 'Bad choice')