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
Post a Comment