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 trialLaknath Gunathilake
1,860 Pointscan't seem to get the even_odd function to work
it says SyntaxError: print "True" when I run this code
def even_odd():
if 8 % 2==0:
print "True"
else:
print "False"
even_odd()
1 Answer
Steven Parker
231,275 PointsHere's a few hints:
- the challenge wants you to return the result, not print it
- the True and False you will return are boolean(logical) values, not strings (so no quotes)
- your function needs to take an argument
- you will perform your test using the argument that is passed in
- you don't need to call your function, just define it. The "check work" will call it and provide the argument(s)
Hopefully these will get you going!
Laknath Gunathilake
1,860 PointsLaknath Gunathilake
1,860 Points