Discuss / Python / 测试通过

测试通过

Topic source

筱枫_Edward

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

L2=[1] t=1

while 1: L1, t = L2, t+1 #L1记录上一次L2的结果 yield L2

L2=[] n=0

while n<t:

if n==0: #L2的第1位判断 L2.append(L1[n])

elif n==t-1: #L2的末位判断 L2.append(L1[n-1])

else: L2.append(L1[n-1] + L1[n])

n=n+1


  • 1

Reply