o = 3 # input('请输入需要计算的黑洞数的位数:')
def jishuan(num):
da = ''
xiao = ''
k = 0
num1 = 10 ** int(o - 1)
while num1 < 10 ** int(o):
i = sorted(str(num1))
a = sorted(str(num1), reverse=True)
for c in i:
da += str(c)
for c in a:
xiao += str(c)
if int(da) - int(xiao) == int(num1):
return num1
else:
num1 += 1
print(jishuan(o))
为什么输出一直为空