I am forever forgetting how to format strings in Python and have probably Googled questions related to Python’s format specification mini-language over a thousand times now. For my own reference I put together a quick-reference for the commands I type most frequently. Maybe it will be useful to other chronic Googlers of the same thing, so feel free to use this for anything that you like.

Python strong formatting cheat sheet.
Python strong formatting cheat sheet.

The new-style Python string formatting quick reference is also available as a PDF here

Tags:

Updated:

Leave a comment