Discuss / Python / 作业

作业

Topic source

Wangde_ful

#1 Created at ... [Delete] [Delete and Lock User]
def is_palindrome(n):
    x = str(n)
    if n in [1,2,3,4,5,6,7,8,9]:
        return True
    for i in range(0,len(x)//2):
        return  x[i] == x[len(x)-1-i] 

  • 1

Reply