Discuss / Python / 作业

作业

Topic source
# -*- coding: utf-8 -*-
def is_palindrome(n):
    if n<10:
        return 
    else:
        return str(n)[::-1] == str(n)

output = filter(is_palindrome,range(1,2000))
print(list(output))

  • 1

Reply