Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

wesley jackson
wesley jackson
2,436 Points

even_odd challenge

When I substitute my return values for print they work fine but once I add the return True/False statements they do not pass. I would appreciate any pointers.

Thank you in advance

WJ

even.py
def even_odd(num):

    num = int(input("Enter your number:"))

    if num % 2 == 0:
        return True
    else:
        return False
wesley jackson
wesley jackson
2,436 Points

Thank you Jason for your swift response. Works a treat :-)

1 Answer

Hi Wesley,

You just need to take out the line where you're getting user input.

The number will be passed into your function as an argument. You don't need to get a number.