String Formatting#

At the end of the day, irrespective of what your Python code was doing in the middle, it typically finishes by outputting some result. Given the omnipresence of printing strings, we want to briefly discuss how to control the formatting and representation of strings, numbers and dates.

Index#

See also

We focus on black-and-white formatting of strings. If you are looking to style your output with colors or represent it in tabular form, have a look at the rich library.