Discuss / Python / 这个为什么不行

这个为什么不行

Topic source

翁岚敏

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

def is_palindrome(n): c=n b=0 while n: a=n%10 b=b*10+a n=n/10 return b==c

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

laputa6616

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

n = (n - a)/10


  • 1

Reply