2. is_even


#1

This is my code:

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

When I submit it says the following: "is_even(-7) returned True instead of the expected: False"


#2

Your comparison is only half right you forgot to put "==0"


#3

you forgot to compare x%2 == 0

try it like this

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

#4

you forgot the == 0 part


#5

Thanks Everybody!!!!!:grinning: