Discuss / Python / 杨式三角形

杨式三角形

Topic source

tycoonBrain

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

def triangles():

    L = [1]

    while True:

        yield L

        L = [sum(i) for i in zip([0]+L, L+[0])]

请问用您的代码进行测试的时候results报错invalid syntax是什么原因呀


  • 1

Reply