def perimeter():
n = 5 nL = [1,1,] if n == 0: return 0 if n == 1: return 1 * 4 if n == 2: return 2 * 4 rl = [nL.append(nL[i]+nL[i-1]) for i in range(1, n)]#这里rl为[None,None,None,None]但是nL为[1,1,3,5,8] print(rl) return 0
本文共 287 字,大约阅读时间需要 1 分钟。
def perimeter():
n = 5 nL = [1,1,] if n == 0: return 0 if n == 1: return 1 * 4 if n == 2: return 2 * 4 rl = [nL.append(nL[i]+nL[i-1]) for i in range(1, n)]#这里rl为[None,None,None,None]但是nL为[1,1,3,5,8] print(rl) return 0
转载于:https://www.cnblogs.com/sayHello2World/p/7155720.html