-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathelifsample.py
More file actions
66 lines (52 loc) · 1.77 KB
/
elifsample.py
File metadata and controls
66 lines (52 loc) · 1.77 KB
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
65
66
#if elif else flow control
#just playing around with variables and loops
#this will be a robot order taker
print("Hello, welcome to our cafe!")
name = input("What is your name?\n")
#greet them with their name and thank them for coming in using concatenatioin
if name == "Ben":
freefood_status = input("Are you looking for a free food?\n")
#nested if
if freefood_status == "Yes":
print("You're not welcome here Ben! Time to leave.")
exit()
else:
print("Oh, well then, come on in.")
else:
print("Nice to meet you " + name + ", thanks for coming in today.\n")
#menu specials
specials = "tomato soup, grilled cheese, greens, and a blt"
print(name + ", our specials for the day are " + specials + ".")
#ask them what they want to order
order = input("What would you like to order?\n\n")
#Set the price for items
#there has to be a way to clean this up
#is there a way to return all combinations effectivly and without the "and" even if the user types it in
if order == "tomato soup":
cost = 6
elif order == "grilled cheese":
cost = 9
elif order == "greens":
cost = 6
elif order == "blt":
cost = 9
elif order == "grilled cheese and greens":
cost = 15
elif order == "grilled cheese and tomato soup":
cost = 15
elif order == "grilled cheese" + "blt":
cost = 18
elif order == "tomato soup" and "greens":
cost = 12
elif order == "tomato soup" and "blt":
cost = 15
elif order == "greens" and "blt":
cost = 15
else:
print("Uh oh, we don't have that item")
exit()
#find out how many they want
#quantity = input("How many would you like?\n\n")
#total = (cost * int(quantity))
print("Sounds great " + name + ", your price for that will be $" + str(cost) + ".")
print("Great! Your " + order + " will be ready shortly!")