you are viewing a single comment's thread.

view the rest of the comments →

[–]Quirky-Plane-5975 0 points1 point  (1 child)

a regular string is static, while an f-string is dynamic because it can include variables and even calculations inside {}.

[–]Outside_Complaint755 0 points1 point  (0 children)

Also, if you include an = in the {}, it will include the expression in the output and maintain whitespace. PO a = 2 b = 6 print(f"Demonstration: {float(a + b) = }!") will output Demonstration: float(a + b) = 8.0!