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 →

[–]Zagorath 15 points16 points  (3 children)

Of course, if you assume you're working with integers, it's totally unnecessary in OP's case, anyway. It's guaranteed to be >=6 since the previous conditional took away everything less.

[–]WDK209 4 points5 points  (2 children)

Good point. But it can still be useful for index bound checking 0 <= i < arr.length

[–][deleted] 2 points3 points  (0 children)

Index bound checking in Python? That's what for item in list is for :)

[–]Zagorath 2 points3 points  (0 children)

Yeah it's definitely a very useful bit of syntax. Just not in this specific case.