Discuss / Python / 作业

作业

Topic source
def is_palindrome1(n):
    n1 = str(n)
    lenn = len(n1)
    i = 1
    a = []
    while i<=lenn:
        a.append(n1[-i])
        i = i+1
    b = int(reduce((lambda x,y:x+y),a))
    return n == b

是不是好麻烦..


  • 1

Reply