Skip to content

Glossary: Data Structures and Algorithms

f-string format codes (:02d, :<, :>)

Also written: :02d, format code, format codes, :<7, :>4

Codes after a colon inside an f-string's braces that control layout: `<` and `>` align text left or right in a given width, and `:02d` prints a whole number at least 2 characters wide with a leading zero, so 9 prints as 09.

Where the book teaches it

Related terms

Floor division (//) and modulo (%)