def is_palindrome(n): L=[] while(n!=0): L.append(n%10) n=n//10 for i in range(len(L)): if L[i]!=L[-(i+1)]: return False return True
Sign in to make a reply
好好学习的菜鸟
def is_palindrome(n): L=[] while(n!=0): L.append(n%10) n=n//10 for i in range(len(L)): if L[i]!=L[-(i+1)]: return False return True