# -*- coding: utf-8 -*-
def triangles():
n , L1 , L2 = 1, [] , [1]
while True:
yield L2
L=L2.copy()
L.insert(0,0)
L.append(0)
L1,L2=L2.copy(),[]
L2=[L[i]+L[i+1] for i in range(len(L)-1)]
Sign in to make a reply
岁益寒
# -*- coding: utf-8 -*-
def triangles():
n , L1 , L2 = 1, [] , [1]
while True:
yield L2
L=L2.copy()
L.insert(0,0)
L.append(0)
L1,L2=L2.copy(),[]
L2=[L[i]+L[i+1] for i in range(len(L)-1)]