3 ms·
Wow! I didn't know if not (1 <= method <= 3) is supported syntax! I would always use method >= 1 and method <= 3
by a_c 9y ago
Wow! I didn't know if not (1 <= method <= 3) is supported syntax! I would always use method >= 1 and method <= 3
- Avshalom 9y agoI seem to remember an article once on how the associativity in cases like this not always lining up with what you think/want so be careful with it.
- ericfrederich 9y agohttps://docs.python.org/3/reference/expressions.html#comparisons https://docs.python.org/3/reference/expressions.html#compari... It's one of those things I probably wouldn't want to use. Like the 'else' clause of a for loop is useful sometimes, but when you use every single feature of a language it makes it harder for newcomers to read.
- scott_karana 9y agoI agree with your principal, but 1<x<9 is bog-standard high school algebra. ;)
- deleted 9y ago[deleted]