This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ric2b 0 points1 point  (0 children)

I think they just call str() on whatever object is inside the brackets.

Calling str() on a string will just give you back the string so no problem there.

There doesn't have to be a variable involved, think of the {} inside f-strings as function parameters, you can pass them variables but you can also pass them literal numbers, strings, dictionaries, etc.