剑指07-斐波那契数列 Posted on 2019-09-12 | In 剑指offer | 题目描述 大家都知道斐波那契数列,现在要求输入一个整数n,请你输出斐波那契数列的第n项(从0开始,第0项为0)。 n<=39 12345678class Solution: def Fibonacci(self, n): # write code here a, b = 0, 1 while n: n -= 1 a, b = b, a+b return a