-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBill_Splitter_App.py
More file actions
36 lines (30 loc) · 1.12 KB
/
Bill_Splitter_App.py
File metadata and controls
36 lines (30 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
while True:
print("Welcome to the bill splitter App")
while True:
Bill = float(input("Enter total bill amount: "))
if Bill <= 0:
print("Bill amount is not negative.")
else:
break
while True:
People = int(input("Enter total number of people: "))
if People <= 0:
print("Number of people is not negative.")
else:
break
while True:
tipp = int(input("Enter tip percentage (0/5/10/15/20): "))
if tipp not in [0, 5, 10, 15, 20]:
print("Tip itni honi chahiye 0, 5, 10, 15, 20.")
else:
break
tipp_amount = (tipp / 100) * Bill
total_bill = Bill + tipp_amount
per_person = total_bill / People
print("Tip Amount: $", "%.2f" % tipp_amount)
print("Total Bill : $", "%.2f" % total_bill)
print("One person pay amount: $", "%.2f" % per_person)
again = input("Would you like to calculate another bill? (y/n): ")
if again.lower() != 'y':
print("THANK YOU FOR USING BILL SPLITTER APP. VISIT AGAIN!")
break