python实现输入

python怎么实现控制输入的数据必须是大于100奇数,谢谢

while True:
    num = input()
    try:
        if int(num)>100 and int(num)%2 == 1:
            print('输入正确')
            break
        else:
            print('输入数字不正确')
    except:
        print('输入有误')
#大于100奇数
while True:
    data = int(input())
    if data >100 and data%2==1:
        print('input correct!')
        break
    

n=input()
if not n.isdigit():
    print('not a number')
elif int(n)<=100:
    print('lower than 100')
elif int(n)%2==0:
    print('not odd but even')
else:
    # do your job
def test(n):
   if n %2 ==1 and n >100:
        return n
   else:
       return '不满足'
n =int(input('输入数据:'))
print(test(n))