Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
modulo solution in Clear category for Is Even by vlad.bezden
"""Is Even
https://py.checkio.org/en/mission/is-even/
Check is the given number is even or not.
Your function should return True if the number is even,
and False if the number is odd.
Input: Int.
Output: Bool.
Example:
is_even(2) == True
is_even(5) == False
is_even(0) == True
Precondition: both given ints should be between -1000 and 1000
"""
def is_even(num: int) -> bool:
return num % 2 == 0
if __name__ == "__main__":
assert is_even(2) is True
assert is_even(5) is False
assert is_even(0) is True
print("PASSED!!!")
July 5, 2020