I have 12.5, and I want to convert it to 13. How can I do this in Python 3?
The task was like this - "Given the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip), and tax percent (the percentage of the meal price being added as tax) for a meal, find and print the meal's total cost"
I solved the problem in Python 3 and in 3 test cases, it shows that my code is working. but in 1 case it is not.
Where,
Sample input:
12.00
20
8
Expected output:
13
And my output was 12.5
How on earth I can take 12.5 as 13?
mealcost = float(input())
tippercent = float(input())
taxpercent = float(input())
tippercent = mealcost * (tippercent / 100)
taxpercent = mealcost * (taxpercent / 100)
totalcost = float( mealcost + tippercent + taxpercent)
print(totalcost)