Discuss / Python / 感觉自己写的好复杂

感觉自己写的好复杂

Topic source

魔泪之光

#1 Created at ... [Delete] [Delete and Lock User]

L = [1] while True: yield(L) length = len(L) n = 0 while n < length - 1: # 在末尾加入新元素 L.insert(length + n, L[n] + L[n + 1]) n = n + 1 L.append(1) k = 0 while k < length - 1: # 去除多余的元素 L.pop(1) k = k + 1


  • 1

Reply