def is_palindrome(n):
l=len(str(n))
i=0
flag=0
while l>0:
if(str(n)[i]==str(n)[-1-i]):
i=i+1
l=l-2
else:
return False
return n
Sign in to make a reply
郭大侠14
def is_palindrome(n):
l=len(str(n))
i=0
flag=0
while l>0:
if(str(n)[i]==str(n)[-1-i]):
i=i+1
l=l-2
else:
return False
return n