-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bill.py
52 lines (36 loc) · 1.71 KB
/
Bill.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
class Store:
product_Code=[]
product_Price=[]
quantity_required=[]
def __init__(self):
self.quantity=int(input("How Many Product do You Have? "))
for i in range(self.quantity):
self.product_Code.append(int(input("Enter Code Of Product: ")))
self.product_Price.append(int(input("Enter Price Of Product: ")))
print()
def display_Menu(self):
print("S.No \t Code \t Price")
for i in range(self.quantity):
print(i+1,"\t",self.product_Code[i],"\t",self.product_Price[i])
print()
def quantity_Required(self):
print("Only Enter the Quantity of Each Item : ")
for i in range(self.quantity):
self.quantity_required.append(int(input()))
print()
def bill(self):
total=0
for i in range(self.quantity):
total+=self.product_Price[i]*self.quantity_required[i]
print("*************HERE IS YOU BILL******************")
print("S.No \t Code \t Price \t Quantity \t Subtotal")
for i in range(self.quantity):
print(i+1,"\t",self.product_Code[i],"\t",self.product_Price[i],"\t",self.quantity_required[i],"\t \t",self.quantity_required[i]*self.product_Price[i])
print("************************************************ \n")
print("Your Final Price: ",total,"\n")
s=Store()
s.display_Menu()
s.quantity_Required()
s.bill()
print("********** THANKS FOR SHOPPING. WE WOULD LOVE TO SEE U AGAIN *********")
print("********** Mail us if you have any Feedback to [[email protected]] **********")