match SyntaxError

Francis Belliveau via Tutor <[email protected]> Mon, 8 Dec 2025 16:50:15 -0500
Newsgroups gmane.comp.python.tutor
Message-ID <[email protected]>
All,
I am sure that my newbee status is going to show on this question.  Running through tutorials and I cannot seem to code a "match" statement correctly.
My sample code looks like:

val = 3
match val:
    case 1:
        print("c1")
    case _:
        print("c_")

I am getting:
    "SyntaxError: invalid syntax" for the line containing "match val:"
The '^' indicator is pointing to the 'v' of "val".

Python version is: 3.9.6 (default, Oct 17 2025, 17:15:53) [Clang 17.0.0 (clang-1700.4.4.1)]  on Mac OS 26.1

My search for answers is not helping but I feel like this should be obvious.
Fran
_______________________________________________
Tutor maillist  -  To unsubscribe send an email to [email protected]
To unsubscribe or change subscription options:
%(web_page_url)slistinfo/%(_internal_name)s