forked from J-Singh99/Facial-Recognition-Interface
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrebuiltBill.py
More file actions
78 lines (63 loc) · 1.71 KB
/
PrebuiltBill.py
File metadata and controls
78 lines (63 loc) · 1.71 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
67
68
69
70
71
72
73
74
75
76
77
78
def DoCalc(ID, bill):
for j in bill:
try:
if bill[j]['ID'] == ID:
items = bill[j]['Items']
sum_ = 0
print('Item Name => Item Price x Item Quantity = Total')
for item in items:
item_name = item[0]
item_price = item[1]
item_quantity = item[2]
total = item_price * item_quantity
sum_ += total
print(item_name, end = ' => ')
print(str(item_price), end = ' x ')
print(str(item_quantity), end = ' = ')
print(str(total))
print('The total bill amounts up to ' + str(sum_))
break
else:
pass
except:
print('Billing Error!!!')
BILL = {}
Entry1 = {
'ID' : 1,
'Items' : [('Bears', 2, 2),
('Beets', 500, 10),
('Battle Star Galactica', 1500, 1),
('Pepsi', 25, 4)]
}
Entry2 = {
'ID' : 2,
'Items' : [('Guitar', 2000, 2),
('TV', 50000, 1),
('Football', 500, 1),
('Pepsi', 25, 4)]
}
Entry3 = {
'ID' : 3,
'Items' : [('White House', 10000, 1),
('AK-47', 5000, 1000),
('Tie', 500, 5),
('Doughnut', 17, 10)]
}
Entry4 = {
'ID' : 4,
'Items' : [('Tesla', 1000, 2),
('Falcon', 50000, 3),
('Flame Thrower', 13000, 3)]
}
Entry5 = {
'ID' : 5,
'Items' : [('Mask', 20000, 4),
('Cape', 50, 10),
('Bat Mobile', 15000, 6),
('Batrang', 25, 4000)]
}
BILL[1] = Entry1
BILL[2] = Entry2
BILL[3] = Entry3
BILL[4] = Entry4
BILL[5] = Entry5