MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/m8l7ip/the_new_switchcase_statement_in_python_310/grlnoa9
r/Python • u/jamescalam • Mar 19 '21
233 comments sorted by
View all comments
Show parent comments
2
The match statement is what defines the y variable. I don't think you understand how it works. This:
match
y
point = [42, 0] match point: case [x, 0]: print(x)
will print 42.
42
1 u/[deleted] Mar 20 '21 Great 👍 less code
1
Great 👍 less code
2
u/xigoi Mar 20 '21
The
matchstatement is what defines theyvariable. I don't think you understand how it works. This:will print
42.