Step: f-string number formatting

f-string number formatting

f-strings support a format spec after a colon — :.2f means "fixed-point, 2 decimal places".

Why it matters: raw floats print with however many digits they happen to have (19.5); format specs give you control for money, percentages, etc.

Example: f"{3.14159:.2f}" becomes "3.14".

Your turn: print price as a dollar amount with exactly two decimal places.

Pitfall: :.2f rounds, it doesn't truncate — 19.505 would print as 19.51 or 19.50 depending on float rounding.

Setup:
price = 19.5
Your code:
Expected output:
$19.50
Step 2 of 18