Skip to content

Latest commit

 

History

History
34 lines (18 loc) · 617 Bytes

Calculate_Meal_Total.md

File metadata and controls

34 lines (18 loc) · 617 Bytes

CodeWars Python Solutions


Calculate Meal Total

Create a function that returns the total of a meal including tip and tax. You should not tip on the tax.

You will be given the subtotal, the tax as a percentage and the tip as a percentage. Please round your result to two decimal places.

Given Code

def calculate_total(subtotal, tax, tip):
    pass

Solution

def calculate_total(subtotal, tax, tip):
    return round(sum([subtotal, subtotal*tax/100, subtotal*tip/100]), 2)

See on CodeWars.com