Colon: block headers and map entries

Syntax and values

Behavior and details

A colon ends a compound header before an indented, nonempty body. Within a Map it separates each key from its value. It is not a type-annotation or slicing operator. A block colon must be followed by a line break, not an inline body.

Example

# language: en
let player = {"score": 12}
if player.score > 10:
    say player.score

Syntax and values · Built-ins · Programming guides