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

victor E
victor E
19,146 Points

I have gotten this far thanks to your help. but I still show an error message

yup

even.py
def even_odd(num):
    for number in num:
        if num % 2 == 0:
            True
        else:
            False

1 Answer

Hi there,

Your code is fine - just remove the for loop as there's nothing to loop over num is just a number. Your testing is correct so remove the second line, fix your indents and return the True and False then you're good to go!

Steve.

victor E
victor E
19,146 Points

Thank you Steve Hunter! much appreciated for your help!

No problem! :+1: