要求输入一个整数n,请你输出斐波那契数列的第n项 python实现

题目描述 你们都知道斐波那契数列,如今要求输入一个整数n,请你输出斐波那契数列的第n项。 n<=39python 使用递归的思路:code def Fibonacci( n): if n == 0: return 0 elif n == 1: return 1 numfn1 = 0 numfn2 = 1 for i in ra
相关文章
相关标签/搜索