is_odd

iteration_utilities.is_odd(value, /)

Returns True if value is odd, otherwise False.

Parameters:

value : any type

The value to test if odd.

Returns:

is_odd : bool

True if value is odd otherwise it returns False.

Examples

This function is equivalent to lambda x: bool(x % 2) but significantly faster:

>>> from iteration_utilities import is_odd
>>> is_odd(0)
False
>>> is_odd(1)
True
>>> is_odd(2)
False