The Python match-case Statement
The Python match-case statement conditionally executes code depending on the value of an expression. It is meant to simplify if-elif-else chains where the conditions are comparisons of the same expression to different values. First introduced in Python version 3.10, the match-case syntax is a relatively late addition to the language.