def triangles():
L = [1]
while 1:
yield L
L = [L[n] + L[n+1] for n in range(len(L) - 1)]
L.insert(0,1)
L.append(1)
Sign in to make a reply
用户5738776098
def triangles():
L = [1]
while 1:
yield L
L = [L[n] + L[n+1] for n in range(len(L) - 1)]
L.insert(0,1)
L.append(1)