This is because you are using an old version of Python (anything before 3.10, when match-case was added). Switching to a later version eliminates this issue.
match
case