#--------------------------------------------------------- # Module name: lect10_3.py # part 2: using a dict to implement a # multiway branch; # By: Sharon M. Tuttle # last modified: 10-26-05 #--------------------------------------------------------- choice = raw_input("What's to eat? ") print {'spam': 1.25, 'ham': 1.99, 'eggs': 0.99, 'bacon': 1.10 } [choice]