python代码块:
str1=str(input('输入小于5位的数字:'))
print('位数为:',len(str1))
str2=str1[::-1] #str2为str1逆序
#print(str2)
if len(str1)<=5:
if str2==str1:
print('是回文数')
else:
print('不是回文数')
else:
print('位数大于5位')