-
Notifications
You must be signed in to change notification settings - Fork 0
/
day_trip_generator.py
64 lines (56 loc) · 2.76 KB
/
day_trip_generator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import random
destinations_list = ['Colorado', 'Florida', 'Arizona', 'New York City', 'Seattle']
restaurants_list =['Steak House', 'Sushi Den', 'Salad Central', 'What did I just eat?', 'Chicken Shack']
mode_of_transport = ['Car', 'Bus', 'Plane', 'Train', 'Teleporter']
entertainment_list = ['to a Musical', 'Haunted Town Tour', 'Fishing Tour', 'Squirrel Wrangling', 'Scavenger Hunt Tour']
# Random generate answer
def random_trip (list_of_options):
output = random.choice(list_of_options)
return (output)
def starting_choices (trip_elements):
trip_elements = ("", "", "", "")
trip_elements[0] = random_trip (destinations_list)
print("Destination: ", trip_elements[0])
trip_elements[1] = random_trip (restaurants_list)
print("Restaurant: ", trip_elements[1])
trip_elements[2] = random_trip (mode_of_transport)
print("Mode of Transport: ", trip_elements[2])
trip_elements[3] = random_trip (entertainment_list)
print("Entertainment: ", trip_elements[3])
return trip_elements
# day trip message
# day_trip = (f'Here is your trip. You have been selected take a {mode} to {destination}, eat at {restaurant}, and go {entertain}!')
# print(day_trip)
# does the trip that spit out meet the user's expectations?
def determine_satisfaction():
trip_satifaction = True
trip_elements = ['', '', '', '']
starting_choices(trip_elements)
while trip_satifaction == True:
user_input = input(f"Is your trip satifactory, Y or N? ")
if user_input == "N" or user_input == "n":
day_trip = change_option(trip_elements)
print(day_trip)
elif user_input == "Y" or user_input == "y":
print(f"Congrats! Now let's get your trip booked.")
trip_satifaction = False
# Which option would they change?:
def change_option(trip_elements):
user_input = input("Which option would you like to change? Destination, Restaurant, Transportation, Entertainment: ")
trip_elements = ["", "", "", ""]
if user_input == "Destination" or user_input == "destination":
destinations_list.remove(trip_elements)
trip_elements[0] = random_trip (destinations_list)
elif user_input == "Restaurant" or user_input == "restaurant":
restaurants_list.remove(trip_elements)
trip_elements[1] = random_trip(restaurants_list)
elif user_input == "Transportation" or user_input == "transportation":
mode_of_transport.remove(trip_elements)
trip_elements[2] = random_trip(mode_of_transport)
elif user_input == "Entertainment" or user_input == "entertainment":
entertainment_list.remove(entertain)
trip_elements[3] = random_trip(entertainment_list)
else:
print('This is not a valid input.')
return trip_elements
determine_satisfaction()