def triangles(): lst = [1] yield lst while True: for i in range(len(lst)-1, 0, -1): lst[i] = lst[i] + lst[i-1] lst.append(1) yield lst
以C语言节省空间的思维写的,不知道在python能不能达到效果
Sign in to make a reply
zlisd
以C语言节省空间的思维写的,不知道在python能不能达到效果