0
help!
what's the meaning of "return not is_even(x)"
3 Respostas
+ 5
Without the code nobody can tell you. I can just guess based on the names, what I would expect from that. is_even seems to be a method, which returns a boolean value, if the given parameter 'x' is an even number or not. The operator 'not' inverts this result, so that this code snippet should return a boolean indicator, if 'x' is an odd number.
+ 2
#something like this?
def is_even(num):
return num%2==0
print(is_even(4))
print(is_even(5))
print(not is_even(4))
print(not is_even(5))
0
thank you, Steven M, Sandra Meyer!!! I turn back to the code and understand it.