r/ProgrammerTIL • • Sep 12 '17

Python [Python] TIL that you can chain comparisons

69 Upvotes

16 comments sorted by

View all comments

Show parent comment

5

u/AnAcceptableUserName Sep 12 '17

That's what I thought. It just didn't seem unintuitive to me, which is why I asked. Thanks for taking the time to confirm.

I can't imagine any good reason for letting your code get to a place you would use a mess of operators in that way, but it's cool to know that you can.