Python · Syntax and control flow

match statement

Structural pattern matching, available from Python 3.10.

Syntax
match value: case pattern:

Example

Open in the lab

More in this group

break and continue del statement enumerate() f-string for if / elif / else pass range()

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course