https://www.jianshu.com/p/7fe7c0dfd216
import operator
#import copy
class Solution:
def isPalindrome(self, x: int) -> bool:
string=str(x)
l=list(string)
#new_l=copy.deepcopy(l)
new_l=l[:]
l.reverse()
if operator.eq(new_l,l):
return True
else:
return False
网友评论