Completed Exercise 7-10 Dream Vacation
This commit is contained in:
parent
7834473b85
commit
0e98e91f3d
22
Chapter_07/7-10_dream_vacation.py
Normal file
22
Chapter_07/7-10_dream_vacation.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# 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.")
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user