用Python判断输入的数是不是回文数
x=int(input('请输入一个整数:'))
a = 0
b=len(str(x))-1
flog=True
while a<b:
if str(x)[a] == str(x)[b]:
a+=1
b-=1
else:
flog=False
break
if flog == True:
print('True')
else:
print('False')
用Python判断输入的数是不是回文数
x=int(input('请输入一个整数:'))
a = 0
b=len(str(x))-1
flog=True
while a<b:
if str(x)[a] == str(x)[b]:
a+=1
b-=1
else:
flog=False
break
if flog == True:
print('True')
else:
print('False')