This commit is contained in:
Tanguy Deleplanque
2025-06-10 13:07:09 +02:00
parent 87d567b8cb
commit 27a71817bc

13
002/task.py Normal file
View File

@ -0,0 +1,13 @@
print("Welcome to the tip calculator!")
bill = input("What was the total bill? $")
tip = ""
while tip not in ["10", "12", "15"]:
tip = input("How much tip would you like to give? 10, 12 or 15? ")
people_nb = input("How many people to split the bill? ")
share = (1+(int(tip)/100)) * float(bill) / int(people_nb)
print(f"Each person should pay ${share:.2f}")