Course map
Stage 1: Foundation
Stage 2: Intermediate
Stage 3: Advanced
Stage 4: DSA in Python
Stage 5: Specialization

Part 02 / Topic 10 of 10

Putting it together: restaurant bill splitter

See examples/06_bill_splitter.py. Short version:

subtotal = 2450
gst = subtotal * 0.05          # 5% GST on restaurant food
tip = subtotal * 0.10          # 10% tip
total = subtotal + gst + tip
people = 4

print(f"Total     : ₹{total:,.2f}")            # Total     : ₹2,817.50
print(f"Per person: ₹{total / people:,.2f}")   # Per person: ₹704.38

Done here? The practice set for Part 2 — 8 exercises with solutions — is on the part page.

Search the guide