Discuss / Python / 练习打卡-Python教程-函数式编程-高阶函数-filter

练习打卡-Python教程-函数式编程-高阶函数-filter

Topic source

南丁叔叔

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

def is_palindrome(n):

    str_n = str(n)

    bool_str = True

    for i in range(len(str_n)//2):

        bool_str = bool_str and str_n[i]==str_n[-i-1]

    return bool_str


  • 1

Reply