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