String Formatting in Python3
With Python3 and 3.6 there are new and much better ways of formatting strings
I don’t use Python string formatting very much and when I do, I normally just use the C-style formatting that has been with Python since the year dot.
But the other day I wanted to format some SQL queries that used the same string a number of times and I was slightly offended by the code that I had to write. So, I decided that I really ought to get up to date and start using the formatting that has been around since the beginning of Python3 and then, maybe, get really modern and look at the f-strings that were introduced in 3.6.
Subscribe to this newsletter to keep up to date with new articles.