# -*- coding:utf-8 -*-classSolution:defFibonacci(self, n):# write code here
a, b, num =0,1,2if n <2:return n
while num<=n:
a, b = b, a+b
num +=1return b
题目描述大家都知道斐波那契数列,现在要求输入一个整数n,请你输出斐波那契数列的第n项(从0开始,第0项为0,第1项是1)。n<=39# -*- coding:utf-8 -*-class Solution: def Fibonacci(self, n): # write code here a, b, num = 0, 1, 2 if n < 2: return n while num<