Discuss / Python / python简洁思路-回文数

python简洁思路-回文数

Topic source

岁益寒

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

# -*- coding: utf-8 -*-

# python简洁思路

def is_palindrome(n):

    s=str(n)

    return s[::-1]==s

it = filter(is_palindrome,range(1,200))

print(list(it))


  • 1

Reply