diff --git a/002/task.py b/002/task.py new file mode 100644 index 0000000..ec89b21 --- /dev/null +++ b/002/task.py @@ -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}") \ No newline at end of file