python - How would I make a condition that requires an odd number in a certain range? -


here pretty simple example of mean:

def work():     x = input("give me number : ")     if x in range(30000):         print "hello" 

so long put in number in range print hello, if want accept odd number in range? tried defining separate function that's range odd numbers this:

def work():     = input("give me number : ")     if in range(30000):        x = range(30001)        y = (2*x)-1        if in range(y):            print "hello" 

but doesn't work.

if 0 <= x < 30000 , x % 2 == 1:     print "hello" 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -