Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple Solution solution in Clear category for Is Even by MarHar
def is_even(num: int) -> bool:
# if num divides by 2 with zero remainder, then return True. Else return False.
return (num % 2) == 0
# Code to check if function works correctly
print("Example:")
print(is_even(2))
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!")
Oct. 30, 2022
Comments: