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 Practice Creating and Using Functions in Python Practice Functions That's Odd

PyCharm interpreter returns correct value for 1 but Challenge test does not:/

When I run the is_odd(1) in PyCharm it returns True as it should but Challenge tests keep complaining that is_odd(1) returns False :/ What is happening? Why the discrepancy?

create_a_function.py
def is_odd(num):
    remainder = num % 2
    if remainder != 0:
        print('True')
    else:
        print('False')
    #elif num == 1: 
        #print('True')
    #else:
        #print('False')

1 Answer

Hi Nataliya

In the challenge you need to use return instead of print.

Edit: Don't forget to lose the parens and the single quotations marks.

Hope this helps!