def triangles(): L = [1] while True: yield L L = [1] +[L[i] + L[i+1] for i in range(len(L)-1)] + [1]
厉害厉害
给大神跪了。
Sign in to make a reply
郝宇臻
def triangles(): L = [1] while True: yield L L = [1] +[L[i] + L[i+1] for i in range(len(L)-1)] + [1]