def triangles(): b = [1] while True: yield b b = [x+y for x,y in zip(b+[0],[0]+b)]
厉害啊! 能请教下思路吗, 是怎么想到前后加0相加的?
Sign in to make a reply
sword_v1