Python has had an awesome sting formatter for a while but their official documentation on it is not very straightforward and far too technical. In this notebook, we'll go through some of the most common use-cases of string formatting in Python and see how flexible formatted string can be!
There are two ways in Python to format a string. The old way uses the %
formatter, while the new, more convenient method uses the .format
method of the string or directly writing a formatted string using f-strings
.