2 is even


#1



Replace this line with your code.


#2

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

#3

what is the problem?


#4

please how to solve this is -even


#5

you should check if the remainder equals zero.

Or reverse the true and false, for even numbers the remainder is zero, which is considered false, so then else runs, and should return true. and the remainder of a odd number is 1, which is considered true, in which case the if clause runs, and should return false

Multiply ways to solve the problem.


#6

2 posts were split to a new topic: 2. is even


#9

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.