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 trialAmayae Williams
Courses Plus Student 711 PointsI 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)
def even_odd(num):
if num % 2 == 0:
print("True")
else:
print("False")
even_odd(11)
1 Answer
Jennifer Nordell
Treehouse TeacherHi 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!
Amayae Williams
Courses Plus Student 711 PointsAmayae Williams
Courses Plus Student 711 PointsThanks! That helped!!