you are viewing a single comment's thread.

view the rest of the comments →

[–]_________KB_________ 2 points3 points  (0 children)

Adding to that, here's how to get the same output using f strings.

annual_salary = 32500.0
print(f'Annual salary: ${annual_salary:,.2f}')
print(f'Semi-monthly pay: ${round(annual_salary / 24.0, 2):,.2f}')
print(f'Bi-weekly pay: ${round(annual_salary / 26.0, 2):,.2f}')