5/11/25, 10:41 AM Untitled69 - Jupyter Notebook
In [ ]: # Existing basic billing system (for comparison)
items = {}
code = 1
total = 0
while True:
name = input("Enter item name (or 'over' to stop): ").capitalize()
if name.lower() == 'over':
break
price = float(input("Enter item price: "))
quantity = int(input("Enter quantity: "))
amt = price * quantity
items[code] = {"name": name, "price": price, "quantity": quantity, "amt": amt}
total += amt
code += 1
print("\n*********** INVOICE ***********")
print("DAV Shop, Kovilambakkam")
print("S. Kolathur, Chennai - 600129")
print("Phone: 073055 09650")
print("-------------------------------")
print(f"{'Code':<5} {'Name':<15} {'Price':<10} {'Qty':<5} {'Amount':<10}")
for c, i in items.items():
print(f"{c:<5} {i['name']:<15} {i['price']:<10.2f} {i['quantity']:<5} {i['amt']:<10.2f}")
print("-------------------------------")
print(f"{'Total':>40}: ₹{total:.2f}")
print("Thank you for shopping!")
localhost:8888/notebooks/Untitled69.ipynb?kernel_name=python3 1/1