python楊輝三角形的實現

def triangles(): L = [1] while True: yield L L = [sum(i) for i in zip([0] + L, L + [0])] def abs(): n = 0 for t in triangles(): print(t) n = n + 1
相關文章
相關標籤/搜索