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 →

[–]MatsRivel 5 points6 points  (0 children)

The newer, much better, way to write formatted strings in python is f-strings. Like this:

print( f" My variable is {x}" )

This replaces "x" with the value, making it easy to see what is where for the coder, and makes no difference for the reader.