Discuss / Python / 转换成字符串,切片颠倒顺序后再转换成整数,两个相等即True。。。这样有毛病吗

转换成字符串,切片颠倒顺序后再转换成整数,两个相等即True。。。这样有毛病吗

Topic source

负精明

#1 Created at ... [Delete] [Delete and Lock User]

def is_palindrome(n):

        return n==int((str(n)[::-1]))


  • 1

Reply