Codecademy Python Answers Tip Calculator

codecademy-tip-calculator

Codecademy Tip Calculator answers

Tip Calculator 1/5 – THE MEAL

# Assign the variable meal the value 44.50 on line 3!

meal = 44.50

Tip Calculator 2/5 – THE MEAL

meal = 44.50
tax = 6.75/100

Tip Calculator 3/5 – THE MEAL

# You're almost there! Assign the tip variable on line 5.

meal = 44.50
tax = 0.0675
tip = 15.0/100

Tip Calculator 4/5 – THE MEAL

# Reassign meal on line 7!

meal = 44.50
tax = 0.0675
tip = 0.15

meal = meal + meal * tax

Tip Calculator 5/5 – THE MEAL

# 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)

Leave a Reply

Your email address will not be published. Required fields are marked *