python 2.7 - Don't understand this Boolean operator logic -


def odd(x):     x % 2     return x > 0 

why function return true numbers?

you need change to:

x = x % 2 

to update variable in line 2.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -