Skip to content

Glossary: Python Basics

match and case

Also written: case, match, match statement

A tidy alternative to a long `if`/`elif` chain, available in Python 3.10 and later. Each `case` names one value to match, and `case _:` catches everything else.

Where the book teaches it

Related terms

if statementelif