You just learned about Python's built-in round() function. Now use it in a realistic scenario.
An online store calculates an item's final price after tax, but the raw calculation produces messy floating-point numbers. Your job is to round the final price to a clean 2 decimal places so it can be displayed to the customer.
Your tasks
Given these starting values:
subtotal = 19.99
tax_rate = 0.0875
1. Calculate the tax amount (subtotal × tax rate) and store it in tax_amount
2. Calculate the raw total (subtotal + tax_amount) and store it in raw_total
3. Use round() to round raw_total to 2 decimal places and store it in final_price
4. Print final_price
Expected output
21.74
Constraints
- Use the built-in
round() function
- Do not use string formatting (
f"{x:.2f}") or format() — this exercise is about round()
- No external libraries