Python string formatting: f-strings to the rescue

Just discovered f-strings for Python string interpolation – much, much better than any of the other formatting techniques such as .format or %.

Example:

print(f'{name} is {age} years old')
Jon is 21 years old

I’ve written a load of examples and notes in an interactive Jupiter notebook, mainly for my own reference:

https://gitlab.com/cds/pythonlearning/blob/master/fstring.ipynb