O'Reilly logo
  • Longxiang Lyu thinks this is interesting:

7-10. Dream Vacation:

From

Cover of Python Crash Course

Note

places = {}

prompt1 = '\nEnter your name: ' prompt2 = 'Enter a place you want to go: ' prompt3 = 'Another? [Y/N]: ' while True: name = raw_input(prompt1) place = raw_input(prompt2) precede = raw_input(prompt3) places[name] = place if precede == 'N': break

print('\nSurvey result:')

for name in sorted(places.keys()): print(name.title() + ": " + places[name])