Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This is a program that calculates how much your total restaurant bill is going to be when taking the meal cost, tip percentage, and tax percentage into factor.
- def bill():
- try:
- meal_cost = float(input('Meal cost?\n'))
- tip_percent = float(input('Tip percent?\n'))
- tax_percent = float(input('Tax percent?\n'))
- total_cost = float(round(meal_cost + tip_percent/100 + meal_cost * tax_percent/100))
- print("The total cost is: " + str(total_cost))
- except:
- if input != float:
- print('Invalid input, please enter a number.')
- bill()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement