python-crash-course/Chapter_07/7-10_dream_vacation.py
2025-02-10 21:09:11 -05:00

23 lines
620 B
Python

# Excercise 7-10 Dream Vacation
# Learning Objective: Fill a dictionary with user input and list dictionary using while loops.
vacation_log = {}
polling_active = True
while polling_active:
name = input("Welcome!\nWhat is your name?\n\t")
location = input("Where is your dream vacation spot?\n\t")
vacation_log[name] = location
repeat = input("Is there another person ready to take the poll?")
if repeat == "no":
polling_active = False
print("\n <<<--- RESULTS: --->>>")
for name, location in vacation_log.items():
print(f"{name} wants to visit {location} on their dream vacay.")