Discuss / Python / 学习大家伙

学习大家伙

Topic source
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

  • 1

Reply