Skip to content
Snippets Groups Projects
Commit e3d3e3db authored by dhana surya's avatar dhana surya
Browse files

tip calculator completed

parent 4a17d485
No related branches found
No related tags found
No related merge requests found
......@@ -3,18 +3,10 @@ Calculate the tip using python
"""
def main():
dollars = dollars_to_float(input("How much was the meal? "))
percent = percent_to_float(input("What percentage would you like to tip? "))
tip = dollars * percent
print(f"Leave ${tip:.2f}")
def dollars_to_float(d):
# TODO
def percent_to_float(p):
# TODO
#get input and typecast into int
dollars = int(input("How much was the meal? "))
percent = int (input("What percentage would you like to tip? "))
tip = dollars * percent /100
print(f"Leave ${tip:.2f}")
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment