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

Amayae Williams
PRO
Amayae Williams
Pro Student 711 Points

I was successful with running this task in workspaces but received an error when submitting. Am I missing something?

The task was to name a function even_odd with a single argument, a number. Return true if even and false if odd. Again in workspaces it worked. Please help.

def even_odd(num): if num % 2 == 0: print("True") else: print("False")

even_odd(11)

even.py
def even_odd(num):
    if num % 2 == 0:
        print("True")
    else:
        print("False")

even_odd(11)

1 Answer

Jennifer Nordell
STAFF
Jennifer Nordell
Treehouse Staff

Hi there! You're really close, but it's not quite what the challenge asked for. The challenge asks you to return True or False (the boolean values), but you are printing the strings "True" or "False".

Here's an example for returning True:

return True

Hope this helps! :sparkles: