0% found this document useful (0 votes)
18 views8 pages

Restaurant Bill Generator in Python

The document outlines a Python project for generating a restaurant bill and exporting it to an Excel file. It includes code for item selection, quantity input, total calculation, and formatting the output with details like GST and token number. The project serves as a practical application of programming concepts relevant to the food service industry.

Uploaded by

dgp625671
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views8 pages

Restaurant Bill Generator in Python

The document outlines a Python project for generating a restaurant bill and exporting it to an Excel file. It includes code for item selection, quantity input, total calculation, and formatting the output with details like GST and token number. The project serves as a practical application of programming concepts relevant to the food service industry.

Uploaded by

dgp625671
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like