Python Python Basics (2015) Number Game App Even or Odd

I don't know how to make number even or odd

I need help figuring out how to get the number even or odd

even.py
def even_odd(number):
    if number%2:
        return True
    else:
        return False

2 Answers

Steven Parker
Steven Parker
176,597 Points

You have the right idea, but you need to return the opposite of the remainder. Try putting "not" in front of the expression.

Can you please explain more about the opposite and "not" and where there should be placed. I am confused. I don't really understand where remainder and expression are.

Steven Parker
Steven Parker
176,597 Points

The expression is "number%2", which calculates a remainder. The "not" would go between that and the "if".

Thank you for explaining