From d3fc4f9a4ae732c43cce3297605b4190046b8905 Mon Sep 17 00:00:00 2001 From: temp Date: Sun, 23 Oct 2022 14:24:22 +0530 Subject: [PATCH] added tip calculator --- tip calculator.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tip calculator.py diff --git a/tip calculator.py b/tip calculator.py new file mode 100644 index 0000000..56e7910 --- /dev/null +++ b/tip calculator.py @@ -0,0 +1,13 @@ +#Calculating the tip +#Using basic arithmetic operators + +print('Welcome to the tip calculator') +bill = float(input('What was the total bill? $')) +tip = int(input('What percentage tip would you like to give? 10, 12 or 15? ')) +no_of_people = int(input('How many people to split the bill? ')) + + +#Result = (Bill + tip%*bill) / Number of people + +result = (bill + (0.01*tip*bill)) / no_of_people +print("Each person should pay: ${:.2f}".format(result)) \ No newline at end of file