Welcome to the Treehouse Community
Looking to learn something new?
Brian S.3,176 Points
Hmmm... any suggestions? Code is doing as I expect, still not getting answer correct.
i also tried altering the Else to: else num % > 0 : print('False') break
def even_odd(num): while True: if num % 2 == 0: print('True') break else: print('False') break
1) Remove the loop and "break" statements-- You don't need to check if a number is odd or even more than once
2) Don't print true or false, use return instead :D -- This is how you get the value out of the function for reuse, rather than just showing the answer on the screen.
Your use of the modulo function is spot on though!
Kristian Gausel14,649 Points
I dont understand why you use a loop. Also it says you should return true or false, not print it. The code looks something like
def even_odd(num): return num % 2 == 0