# Tip calculator # Reassign meal on line 7

#1

1 # Reassign meal on line 7!
2 meal = 44.50
3
4 tax = 0.0675
5 tip = 0.15
6 44.50 * 0.0675 = 44.50 + 3.00375 = 47.50375
7 meal = 47.50375

Can someone please explain what I am doing wrong. Thanks a lo

#2

You cant use the equal sign like that; try this instead:

``meal = meal * tax + meal * tip + meal``

#3

meal = 44.50
tax = 0.0675
tip = 0.15
meal=meal+meal*tax

#4

i did what you said and i am still getting it wrong

#6

meal = 44.50
tax = 0.0675
tip = 0.15

meal = meal + meal * tax
total = meal + meal *tip

print("%.2f" % total)
try this code hope it works

#7

this code doesn't work

#8

#9

Sorry to know it didnt work it worked for me though.

#11

Code that worked for me:
# Reassign meal on line 7!

``````meal = 44.50
tax = 0.0675
tip = 0.15

meal = meal + meal * tax``````

#12

problem with the code ? And where is "tip"?

#13

Thank u! I did what u said and it worked. Mental high-five!

#14

thanks, that really helped

#15

A post was split to a new topic: Tip calculator

#16