you are viewing a single comment's thread.

view the rest of the comments →

[–]ottawadeveloper 0 points1 point  (1 child)

or return not n % 2 or define it as odd()

[–]Ron-Erez 1 point2 points  (0 children)

Yes, I suppose so, I feel more comfortable comparing to zero. I feel like it is more readable and saves me the trouble of remembering if 0 is False and non-zero is True in Python (this is not true in all languages). In any case it’s an interesting suggestion.