-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhotelbill.py
118 lines (93 loc) · 2.5 KB
/
hotelbill.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#this is my python lab mini project
#-------------------------SATHWIK.R
#-------------------------SHRADDESH
#-------------------------SIDDANTH
#createing the menu
menu={
"pizza":{
"small":{
"cost": 100,
"quantity":0
},
"medium":{
"cost": 200,
"quantity":0
},
"large":{
"cost": 300,
"quantity":0
}
},
"burger":{
"small":{
"cost":100,
"quantity":0
},
"medium":{
"cost":100,
"quantity":0
},
"large":{
"cost":100,
"quantity":0
}
},
"coke":{
"small":{
"cost":100,
"quantity":0
},
"medium":{
"cost":200,
"quantity":0
},
"large":{
"cost":300,
"quantity":0
}
},
"Chicken":{
"small":{
"cost":100,
"quantity":0
},
"medium":{
"cost":200,
"quantity":0
},
"large":{
"cost":300,
"quantity":0
}
}
}
#bill the following
def bill(menu):
total_bill=0
for item in menu:
for size in menu[item]:
total_bill += menu[item][size]["cost"] * menu[item][size]["quantity"]
return total_bill
#order of the entire program
def order(menu):
while(1):
print("OUR MENU\n1.pizza\n2.burger\n3.coke\n4.chicken\n\n\n")
item =input("\nENTER THE ITEM YOU NEED TO ORDER\n")
if item not in menu:
print("WE ARE SORRY!!!!!\nTHE ITEM IS NOT AVILABLE IN OUR HOTEL")
continue
print("THE SIZE AVILABLE ARE \n1.small\n2.medium\n3.large\n\n")
size = input("\nENTER THE SIZE OF THE ITEM\n")
if size not in menu[item]:
print("WE ARE SORRY!!!!\nWE DONT WHAVE THAT SIZE ")
continue
quantity=int(input("\nENTER THE QUNTITY\n"))
menu[item][size]["quantity"] += quantity
print("YOUR ORDER HAS BEEN PLACED ")
print("YOUR BILL IS",bill(menu))
print("\nTHANK YOU FOR OUR ORDER \n VISIT AGAIN :)")
print("DO YOU WANT TO ORDER MORE?? (Y/N) ")
choice = input()
if choice == "N":
break
order(menu)