九州体育网 - 十年信誉网站

Discuss / Python / 用zip函数最优雅

用zip函数最优雅

Topic source

遥望君山

#1 Created at ... [] []
def triangles():
    r = [1]
    while True:
        yield r
        a = [0] + r
        b = r + [0]
        r = [x + y for x, y in zip(a, b)]


  • 1

Reply