python – Rounding floats with f-string

python – Rounding floats with f-string

How about this

x = 3.14159265
print(fpi = {x:.2f})

Docs for f-strings

python – Rounding floats with f-string

Leave a Reply

Your email address will not be published.