I have been tweeting about Python π string formatting.
I have been preaching π that f-strings are the best string formatting alternative.
Then comes the string method `.format`.
And only then, %-formatting.
Here is a thread 𧡠comparing the 3 π
In its most basic form,
π %-formatting uses % and a letter inside the string
π `.format` replaces sequences of {} with the data
π f-strings use {} to insert the data _inside_ the string
Here is how it looks like π
An undervalued feature of string formatting is that you can easily determine whether your data should be formatted with its string (str) or with its representation (repr).