美文网首页
LeetCode_Palindrome Number

LeetCode_Palindrome Number

作者: 钱晓缺 | 来源:发表于2019-12-26 14:42 被阅读0次

    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

    相关文章

      网友评论

          本文标题:LeetCode_Palindrome Number

          本文链接:https://www.haomeiwen.com/subject/jhakoctx.html