Post History
Python 3, 10 bytes 1 .__and__ Try it online! Returns 1 for odd numbers and 0 for even numbers. Two bytes shorter than the trivial lambda x:x%2 and one byte shorter than the equivalent magic...
Answer
#1: Initial revision
# [Python 3], 10 bytes <!-- language-all: lang-python --> 1 .__and__ [Try it online!][TIO-kqft4fyw] [Python 3]: https://docs.python.org/3/ [TIO-kqft4fyw]: https://tio.run/##K6gsycjPM/6fZhvz31BBLz4@MS8lPv5/Wn6RQqZCZp5CUWJeeqqGoYGBphUXZ0FRZl6JRqaOQppGpqbmfwA "Python 3 – Try It Online" Returns `1` for odd numbers and `0` for even numbers. Two bytes shorter than the trivial `lambda x:x%2` and one byte shorter than the equivalent magic function `2 .__rmod__`.