RESTAURANT BILL
AIM:
• Making the restaurant bill and print in excel.
CODE:
• Code1
Def item_bill():
Print()
Import datetime
Import pandas as pd
Import os
Import numpy as np
Q={}
R=[]
Names=[]
W=[]
Y = {}
Ti=[]
Ff=[Link]([y])
Ex={
“Sell”:ff }
D={
“ch”: “Chinese Puff”,
“no”: “Normal Puff”,
“je”: “Jeera Soda”,
“bu”: “Butter Dabeli”,
“cd”: “Cheese Dabeli”,
“pi”: “Pizza”,
“te”: “Tea”,
“do”: “Dosa”,
“sa”: “Samosa”,
“va”: “Vadapav”,
“co”: “Coffee”
}
G={ “ch”:20,
“no”:15,
“je”:10,
“bu”:30,
“pi”:60,
“te”:10,
“do”:90,
“sa”:30,
“va”:35,
“co”:20,
“cd”:40
}
Print(“------------------------------“)
For u in range(1, 16):
U = input(“Enter item name: “)
F = input(“Enter Qty: “)
Print(“------------------------------“)
If(u==”d”):
Print(“------------------------------“)
Print(y)
Print(“------------------------------“)
Z=sum(r)
Print(f” Total Bill—{z}”)
Print(“------------------------------“)
Break
Elif(u in d ):
Value = [Link](u)
Total = g[u] *int(f)
Q[d[u]] = g[u]
Print(f” price of {value}-- {g[u]}”)
Print(“ -----------“)
Print(f” Qty -- {f}”)
Print(“ -----------“)
Print(f” Total-- {total}”)
Print(“------------------------------“)
[Link]({value:f})
[Link](int(total))
[Link](int(f))
[Link](str(value)
else:
print(f”Item ‘{u}’ is not available!”)
print(“------------------------------“)
df=[Link](ex)
df.to_excel(“[Link]”,index=False)
[Link](“[Link]”)
• Code 2
Import datetime
Import random
Import pandas as pa
From s import item_bill,r,w,names
U= item_bill()
F= item_bill()
Ww=input(“enter counter no:”)
Print(“\n\n”)
I=6
Print(“\n APC Chhatralay “)
Print(“ Sardar Patel Marg,”)
Print(“ Vallabh Vidyanagar , Gujarat 388120\n”)
Print(“Date:”,end=” “)
Print([Link]().strftime(“%d-%m-%Y
%I:%M:%S”))
Print(end=” “)
Print(“station:”,i)
A=[Link](1,500)
Print(“Token #:”,end=” “)
Print(a)
Print(end=” “)
Print(“Quick Sell”)
Print(“---------------------------------------------“)
Print(“Qty”,end=” “)
Print(“Item”,end=” “)
Print(“Amount”)
Print(“---------------------------------------------“)
For qty, name, amt in zip(w, names, r):
Print(f”{qty:<10}{name:<30}₹{amt}”)
Print(“ --------------“)
Print(“ --------------“)
Print(f”Total Charge: {sum(r)}”)
Print(f”Visa Card: {sum(r)}”)
Print(“********************************************
*”)
Print(“ GST NO:24AABTP2866J1ZC “)
Print(“ Jay Swaminarayan \n\n”)
Print(“ THANK YOU FOR VISIT !........\n\n”)
Print(f” Counter:{ww} \n”)
Print(“Server : Cashier 2”,end=” “)
Print(“Station: 6”)
Print(“TOKEN #”,a)
Print(“---------------------------------------------“)
Print(“Qty”,end=” “)
Print(“Item”,end=” “)
Print(“Amount”)
Print(“---------------------------------------------“)
For qty, name, amt in zip(w, names, r):
Print(f”{qty:<10}{name:<30}₹{amt}”)
Print(“********************************************
*\n\n\n”)
OUTPUT:
• Excel file:
• Bill
CONCLUSION:
The restaurant bill Python project successfully
demonstrates how to calculate the total bill, including
itemized orders, tax, and tip. It helps users
understand key programming concepts like
input/output handling, arithmetic operations, and
conditional logic. This project is a practical
application of Python for real-life scenarios in the
food and service industry.