Discuss / Python / 人生苦短,我用Python

人生苦短,我用Python

Topic source

hcie_zpc

#1 Created at ... [Delete] [Delete and Lock User]
def is_palindrome(n):
    x = n
    y = 0
    while x != 0 :  # 反向求整数
        y *= 10
        y += (x%10)
        x //= 10
    return y == n

  • 1

Reply