Tip Calculator


#1

# Assign the variable total on line 8!

meal = 44.50
tax = 0.0675
tip = 0.15

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

print("%.2f" % total)

Why won't this code work? I don't know why! I have tried everything!


#2

Is there something wrong with the indentions?


#3

Your code above is fine and if it is indented like this it should work,

meal = 44.50
tax = 0.0675
tip = 0.15

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

print("%.2f" % total)

#4

Ok that worked thank you very much! bandit!


#5

You're welcome :slight_smile:


#6

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