Won't print? Help


#1

x = raw_input("Enter a number:")
if x.isdigit():

def is_even (x):
    if x % 2 == 0:
        print "Your number, %d is even." % x
        return True

    else:
        return False
        print "Your number, %d is odd." % x

else:
print "That's not a number!"
x = raw_input("Enter another number:")

Okay, so while this "passes" the exercise, it doesn't print out whether it is odd or even, what am i doing wrong?
Thanks


#2

try this instead . Always make the method implementation separate.

def is_even (x):
    if x % 2 == 0:
        print "Your number, %d is even." % x
        return True
    else:
        print "Your number, %d is odd." % x
        return False
        

x = raw_input("Enter a number:")
while(not x.isdigit()):
    print "That's not a number! \n"
    x = raw_input("Enter another number:")
    
print is_even(int(x))