β All terms Β· Syntax
f-string
An f-prefixed string literal that lets you inline expressions: `f"x={x}"`. Introduced in Python 3.6, now the default formatter.
f"hi {name.upper()}"Learn this interactively:
Open lesson lesson-08 βRelated β Syntax
Walrus operator`:=` assigns inside an expression. Useful when you'd otherwise compute the same β¦Type hintsAnnotations that describe expected types: `def f(x: int) -> str:`. Not enforced β¦Truthy / falsyValues that act as True / False in `if` statements. Empty containers, `0`, `Noneβ¦SlicingSubstring/sublist via `s[start:stop:step]`. Negative indices count from the end.