Discuss / Python / 杨辉三角

杨辉三角

Topic source

苏晨飞

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

 L = [1]

 for n in range(10):

  yield list(L)

  for i in range(1,len(L)):

   L[-i] = L[-i] + L[-i-1]

  L.append(1)


  • 1

Reply