Is_even


#1

what is the problem for my code,confused

def is_even(x):
x=int(raw_input())
if x % 2 == 0:
return True
else:
return False


#2

anybody can help me ,thank you very much!


#3

This is supposed to be a utility function that returns a boolean to a simple question. We would never expect user input in the transaction, unless it is before the function call. x is already a parameter that is a value passed in to the function. That line can be safely removed.


#4

thank you very much,i made a very stupid mistakeļ¼


#5

Like we all do. For the sake of your sanity, forget you ever knew what an adjective is. The less we apply them to ourselves, the better chance of being who we really are. Love and relish mistakes. They are the building blocks of success.


#6

yea! I nedd the mistake to remind myself ,so 'Love and relish mistakes!!!' thank you again1


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.