Is that difference even possible in this problem?


#1

When I put in my code, I get 54.18 instead of 54.63, Is that difference even possible in this problem?

meal = 44.50
tax = 0.0675
tip = 0.15

total = (meal * tax) + (meal * tip) + meal

print("%.2f" % total)


It's suppose to be right? What is wrong? Oops, try again. It looks like the printed output is 50.71 instead of 54.63. Double check the instructions!
#2

The instructions ask for something along these lines,

meal = meal + meal * tax

total = meal + meal * tip

>>> meal = 44.50
>>> tax = 0.0675
>>> tip = 0.15
>>> meal = meal + meal * tax
>>> total = meal + meal * tip
>>> total
54.6293125
>>> print("%.2f" % total)
54.63
>>>

#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.