Write a tip calculator in Python. if the total bill for the meal is $32.87, and the tip amount is 15% what will be the amount of the tip? And what will be the final total?

 

 

>>> numerator = 32.87
>>> denominator = 15
>>> result = numerator / denominator
>>> rounded_result = round(result,2)
>>> print(rounded_result)
2.19

>>> total = (32.87 + 2.19)
>>> total = round(32.87 + 2.19,2)
>>> print(total)
35.06
>>> 

 

 

Go Back