发布网友 发布时间:2022-04-23 15:48
共1个回答
热心网友 时间:2022-04-06 11:24
def ishuiweinum(num):
if not isinstance(num,int):
return False
if num<0:
return False
numlist=[]
while num>0:
numlist.append(num%10)
num/=10
reverselist=numlist[:]
reverselist.reverse()
return reverselist==numlist
if __name__=='__main__':
print(ishuiweinum(12345))
print(ishuiweinum(1234321))