Discuss / Python / 作业题

作业题

Topic source

冲天魔王

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

def is_palindrome(n): f=str(n) print("前%s后%s"%(f[0],f[-1])) if len(f)==1: return True return f[0]!=f[-1] output = filter(is_palindrome, range(1, 999)) print(list(output)) 另外问句我代码 len(f)==1?f[0]!=f[-1]:True 哪里错了?


  • 1

Reply