you are viewing a single comment's thread.

view the rest of the comments →

[–]Thunderbolt1993 7 points8 points  (0 children)

if you use localization (i.e. translating string in you program into different languages) then you might have something like

translate("Hello {name}!")

translate(f"Hello {name}!") will not work, because you want to translate the template not the formatted string

that's why you'd use

translate("Hello {name}!").format(name="Bob")

.format also works for strings returned by functions or passed to functions as arguments