5 ms·
I would go for more pythonic "not i % 2".
by l0nwlf 16y ago
I would go for more pythonic "not i % 2".
- fjh 16y agoI would argue that that is not very pythonic, since it breaks the "explicit is better than implicit" guideline.
- koenigdavidmj 16y agoMost Python people are okay with relying on the behaviour of what is truthful and what is not. They would often prefer to see if foo: do_stuff() over if len(foo) > 0: do_stuff()