format_price(amount) that returns amount formatted as a string with exactly two decimal places and a leading $, e.g. 9 becomes "$9.00". Use an f-string with a format spec, not manual string concatenation.format_price(9)
'$9.00'
Integer padded to two decimals.
format_price(19.5)
'$19.50'
One decimal digit padded to two.
f"${amount:.2f}" does the formatting in one step.
The :.2f spec always shows two digits after the decimal point.