Toggle navigation
Mr. Code's Wild Ride
Mr. Code
Curriculum
Showcase
Python
Math
Games
Typing
Sign in
Tip Calculator
Math
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
Step 6:
Show the tip and total cost to the user. Format both to two decimal places for the cents.
Hint:
Use
:.2f
to format a number to two decimal places:
print(f"\nTip: ${your_variable
:.2f
}")
Last step
Next section
×
Sign in