# Only supported 3.10+ # _ is the symbol for wildcard match value: case Case1: ... case Case2: ... case (5, _): # if value is some tuple with first element 5 ... case _: # you can implement a fall-through like this ...
Here is what the above code is Doing:
1. It’s creating a match expression.
2. It’s matching the value against the cases.
3. It’s using the wildcard symbol _ to match any value.
4. It’s using a fall-through case to match any value.
You can also match against multiple values: