python while的使用

res,hui,hui2=0,0,0
tmp=int(input())
while res!=0:
    f=tmp//10000
    y=f+1
    date=y//1000+(y//100)%10+(y//10)%10+y%10+y*10000
    if check(date)==true:
        hui=date
    if y//1000==(y//10)%10 and (y//100)%10==y%10 and check(date)==true:
        hui2=date
        res+=1

怎么才能得到我想得到的hui和hui2在while外部

你的 res=0,循环条件 res!=0 不成立,不会执行循环体,hui 和 hui2 当然还是 0