Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

c=str(input("Enter the customer name:"))

n=int(input('Enter the number of Item:'))


d={}
T=0
Tp=0
from prettytable import PrettyTable
for a in range (n) :
print('Enter the name of Item No.',a+1,':',end='')
I=str(input())
p=int(input('Price:'))
q=int(input('Quantity :'))
T+=p*q
d[I]={'price':p,'Quantity':q}
a=0
Q=PrettyTable(['Item No','Item Name','Price','Quantity','Sub total'])

for key in d:
a+=1
s='Item No.'+ str(a)
Q.add_row([s,key,str(d[key]['price']),
str(d[key]['Quantity']),int(d[key]['price'])*int(d[key]['Quantity'])])
Tp+=int(d[key]['price'])*int(d[key]['Quantity'])
print("TOTAL BILL")
print(c)
print('Total no of things:',n)
print(Q)
print("Your total amount have to be payed",Tp)
print("THANK YOU FOR VISITING")

You might also like