Courses/Advanced Typing

๐Ÿ”ค Advanced Typing

f-string Format Spec

Padding, precision, binary, hex โ€” all inline.

f-strings accept a format spec after :. >8 right-aligns in width 8, 6.2f is float with 2 decimals in width 6, 08b is 8-digit binary with zero-padding.

main.py
Output
Press Run to execute.
Expected output
     Ada |  91.26
00101010

Sign in to track your progress across lessons.