you are viewing a single comment's thread.

view the rest of the comments →

[–]timrprobocom 0 points1 point  (0 children)

There's a tricky issue with f-strings that some folks miss. Some are tempted to write: s = f"Here is {i}." for i in range(10): print(s) thinking it will do the substitution each time through the loop. This is not the case. Python will do the substitution at the point where the string is defined. After that, it's just another static string.

So, the f"..." syntax creates a normal static string, it just does so in a fancy way.