Discuss / Python / 半抄半理解写的杨辉三角作业:

半抄半理解写的杨辉三角作业:

Topic source

    L = [1]

    n = 0

    while n < 10:

        yield L

        L = [1] + [L[x]+L[x+1] for x in range(len(L)-1)] + [1]

        n = n + 1


  • 1

Reply