Discuss / Python / 想了很久,写不出来,抄的

想了很久,写不出来,抄的

Topic source
def triangles():
  L = [1]
  while True:
    yield L
    L = L + [0]
    L = [L[i] + L[i - 1] for i in range(len(L))]

  • 1

Reply