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

Emilio Andere
Emilio Andere
495 Points

WHY

need info

even.py
import random

def even_odd(num):
    return num % 2 == 0

while True:

    if even_odd == (2,4):
        return(True)
        break
    else:
        return(False)

Hi Emilio!

You're doing more than you're suppose to. You dont need to import de random module and also you dont need the while statement.

All you need to complete the challenge is your function, which is very good.

def even_odd(num):
    return num % 2 == 0

2 Answers

Steven Parker
Steven Parker
231,271 Points

Emmanuel is correct. It looks like you're confusing this challenge with one from another course which does require a loop and a random number.

Always read the instructions carefully, and do only what they ask for!

Emilio Andere
Emilio Andere
495 Points

thank you, Steven, always so helpful!