def triangles(): l = [] # 第一行 while True: l = [1] + [l[x - 1] + l[x] for x in range(1, len(l))] + [0] yield l[:-1]
Sign in to make a reply
郭浩伟77700
def triangles(): l = [] # 第一行 while True: l = [1] + [l[x - 1] + l[x] for x in range(1, len(l))] + [0] yield l[:-1]