tracks

Sign in Sign up
1/5
Tip Calculator
The Meal

Now let's apply the concepts from the previous section to a real world example.

You've finished eating at a restaurant, and received this bill:

  • Cost of meal: $44.50
  • Restaurant tax: 6.75%
  • Tip: 15%

You'll apply the tip to the overall cost of the meal (including tax).

Instructions

First, let's declare the variable meal and assign it the value 44.50.

?
Stuck? Get a hint! Hint

Don't use any dollar signs ($)—just the numerical cost of the meal, 44.50.

Remember, we can assign a value to a variable like so:

variable_name = 10
script.py
Back to Editor

Sign in