Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Is Even by undertow
# Pythonic solve. Set is_even variable to n. Return value of Boolean expression (True or False) using modulo
def is_even(n) -> bool:
return n % 2 == 0
print("Example:")
print(is_even(2))
# These "asserts" are used for self-checking
assert is_even(2) == True
assert is_even(5) == False
assert is_even(0) == True
print("The mission is done! Click 'Check Solution' to earn rewards!")
May 26, 2023