Python f-string cheat sheets (2022)

50 shlomo_z 3 8/21/2025, 5:08:08 AM fstring.help ↗

Comments (3)

nickcw · 11m ago
From the f-strings PEP 498

https://peps.python.org/pep-0498/

> This PEP is driven by the desire to have a simpler way to format strings in Python.

I think f-strings have become the thing they were trying to replace and they are now more complicated than the old % interpolation.

I still like f-strings and use them a lot but if you look at the cheat sheet, they are no longer simple.

asicsp · 9m ago
See also this quiz: https://fstrings.wtf/
xavdid · 1h ago
Ah, these are great! f-strings are so powerful, but I can never remember the arcane little syntax. Definitely bookmarking this.