Thursday, May 22, 2014

Day 47

Explored Python at CodeCademy. Worked on Python tutorial 5 of 5, Tip Calculator, The Total. Created a "total" value to come up with the total cost of the meal.

The code used:
# Assign the variable total
meal = 44.50
tax = 0.0675
tip = 0.15
meal = meal + meal * tax
total = meal + meal * tip
print("%.2f" % total)

The interaction looked like this:
54.63

No comments:

Post a Comment