Replies: 1 comment 2 replies
-
Related: I don't think this is a very useful feature. For more complex cases and for greater clarity, we still need to include the variable name: match x:
x < 0:
print("Negative number")
0 <= x <= 9:
print("Digit")
x >= 10:
print("Multi-digit positive number") Which is essentially the same as For numbers specifically, we could add a range pattern syntax, but I'm not sure if this will be used often: match x:
..-1:
print("Negative number")
0..9:
print("Digit")
10..:
print("Multi-digit positive number") |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Beta Was this translation helpful? Give feedback.
All reactions