+ 1

Was on python 3 learning, project on fibo

How should I do the recursion fibo in python 3 course Given num = int(input()) Def Fibonacci(n) Fibonacci(num) Code I wrote # below function For n in range (num): If n == 0: return 0 else: return Fibonacci(n)+ Fibonacci(n-1) Code appear either no output, output 0, int type not iterable, max recursion depth exceeding. How should I solve this. Thanks

17th Oct 2020, 2:31 AM
Zhi Xian
Zhi Xian - avatar
5 Antworten
+ 4
Zhi Xian check this code again please..
17th Oct 2020, 2:49 AM
Minho
Minho - avatar
17th Oct 2020, 2:42 AM
Minho
Minho - avatar
0
but in python 3 lesson required me to print like a list out but not with the list
17th Oct 2020, 2:44 AM
Zhi Xian
Zhi Xian - avatar
0
like in put is 5 output should be below 0 1 1 2 3
17th Oct 2020, 2:44 AM
Zhi Xian
Zhi Xian - avatar
0
instead of listing like below [0,1,1,2,3]
17th Oct 2020, 2:45 AM
Zhi Xian
Zhi Xian - avatar