Discuss / Python / 补作业!

补作业!

Topic source

def triangles(): L=[1] while True: yield L L.append(0) L=[L[i-1]+L[i] for i in range(len(L))] YangHui=triangles() for n in range(10): print(next(YangHui))

另外想问问各位大佬,如果已知行和列,如何打出杨辉三角中该坐标所指向的数字?


  • 1

Reply