# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
def fibonacci(n):
if n == 0 or n == 1: return [1];
result = [1, 1]
if n == 2:
return result;
while True:
current = result[-1] + result[-2];
if current > n: break;
result.append(current);
return result;
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
argument = 100 ;
fiboList = fibonacci(argument);
fiboList = fiboList[1:len(fiboList)-1];
fiboList.reverse();
s: int = 0;
if fiboList is not None:
if len(fiboList)>= 1:
s = fiboList[0] ;
if len(fiboList) >=2:
s = fiboList[1]+s;
print(s)
评论