alist = [0, 1] def n(l=10): l = int(input('lenth:')) for i in range(l - len(alist)): # alist.append[l] = alist[-1] + alist[-2] alist.append(alist[-1] + alist[-2]) print(alist) # return alist # print(n) if __name__ == '__main__': n()
alist = [0, 1] def n(l=10): l = int(input('lenth:')) for i in range(l - len(alist)): # alist.append[l] = alist[-1] + alist[-2] alist.append(alist[-1] + alist[-2]) print(alist) # return alist # print(n) if __name__ == '__main__': n()
相关课程