Discuss / Python / 感觉有点长

感觉有点长

Topic source

def back_1(): n = 1 while True: yield n n = n + 1

def back_2(x): return str(x) == str(x)[::-1]

def back_3(): it = back_1() while True: n = next(it) yield n it = filter(back_2, it)

for t in back_3(): if t < 200: print(t) else: break


  • 1

Reply