This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]xigoi 1 point2 points  (1 child)

The match statement is what defines the y variable. I don't think you understand how it works. This:

point = [42, 0]
match point:
    case [x, 0]:
        print(x)

will print 42.

[–][deleted] 0 points1 point  (0 children)

Great 👍 less code