Lesson 2 is_even Pl help where is the problem


#1

My code is as below.

def is_even(x):
if x%2== int:
return True
else:
return False


#2

the remainder of even numbers is zero, not sure why you compare with int


#3

Your

if x % 2 == int:

is a little off. The modulus function, dividend % divisor, produces the remainder. So if you want to determine whether the number is even, your remainder should be 0.