Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tip calculator.py
Original file line number Diff line number Diff line change
@@ -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))