Created
March 20, 2015 21:29
-
-
Save mitgr81/5554ca310bf8e9015726 to your computer and use it in GitHub Desktop.
Tipper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
percentify = lambda number, percentage: float(number) * (percentage / 100) | |
restaraunt_tax_percentage = 6.75 | |
tip_percentage = 15 | |
meal = float(input("How much was the meal? $") or 44.50) | |
restaraunt_tax = percentify(meal, restaraunt_tax_percentage) | |
tip = percentify(meal + restaraunt_tax, tip_percentage) | |
print("Your tip should be ${:.2f}".format(tip)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment