Skip to content

Glossary: Refactoring and Clean Code

f-string

Also written: format spec, :<8, :>11.2f

A Python string like `f"{label:<12}{amount:>11.2f}"` that inserts values. Codes after the colon set alignment and width: `<` left, `>` right, `.2f` two decimals.

Where the book teaches it

Related terms

DRY (Don't Repeat Yourself)