Why is it meal+meal* tax?


#1



https://www.codecademy.com/courses/python-beginner-GB6hM/0/4?curriculum_id=4f89dab3d788890003000096#


I am not understanding why it is "meal+meal*tax" instead of "meal * tax"


# Reassign meal on line 7!

meal = 44.50
tax = 0.0675
tip = 0.15

meal = meal+meal *tax


#2

Meal = meal+meal*tax because if it was just meal*tax you would just be getting the total amount of tax added onto the meal. To get the total cost of the meal which is assigned, you need to do meal + meal * tax which is 51.18. The cost of the meal in the end is the meal along with the tax on that meal.


#3

As @matt_schu already said you need the meal and the taxex for the meal. If you just want to write meal*tax, then you need to adjust the tax: 1.15 instead of 0.15


#4

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