Language Delimiters

: — colon

Separates a compound statement header from its suite, a dictionary key from its value, slice bounds, or a name from its annotation. Meaning is determined by grammar context.

Formal Syntax & Structure

python syntaxpython
:

Return Value

Not applicable

Grammar token; the enclosing construct determines any result.

Working Example

Example Snippetpython
data = {'price': 25}if data['price'] > 0:    print(data['price'])
Python Reference