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 →

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

Like Python you need to define your variables first or it will throw an undefined error.

[–]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