def triangles(): list1 = [1] while True: list2 = list1.copy() yield (list1) if len(list1) >= 2: for i in range(1, len(list1)): list2[i] = list1[i-1] + list1[i] list2.append(1) list1 = list2
Sign in to make a reply
天天向上ykyk