Professional Documents
Culture Documents
Billing Full Code Python
Billing Full Code Python
Billing Full Code Python
cat=[]
price=[]
qua=[]
total=[]
SGST=[]
CGST=[]
final=[]
i=0
gt=0
while(True):
i=i+1
print("Enter details of product",i,":")
n=input("Enter product name:")
c=input("Enter product category:")
p=float(input("Enter price:"))
q=float(input("Enter quantity:"))
t=p*q
if c=="food":
g=5/100*t
elif c=="elec":
g=18/100*t
elif c=="cloth":
g=12/100*t
sg=g/2
cg=g/2
f=t+g
name.append(n)
cat.append(c)
price.append(p)
qua.append(q)
total.append(t)
SGST.append(sg)
CGST.append(cg)
final.append(f)
gt=gt+f
ch=input("Do you wish to add more products in bill(y/n)?:")
if ch=='n':
break
if gt>=500:
d=10/100*gt
else:
d=5/100*gt
fi=gt-d
print("Grand Total:Rs",round(gt,2))
print("Discount:Rs",round(d,2))
print("Final Payment:Rs",round(fi,2))
print(" HAPPY SHOPPING")
print(" PLEASE VISIT AGAIN")