+ 1
Please check my code in description:
#what is the error in this code ?? I wanna make fibonacci series. num = int(input()) def fibonacci(n): for i in range(n+1): print(i) temp = i res += temp print(res) fibonacci(num) #output should be like : 0 1 1 2 3 5 8 13 ...
2 Réponses
0
To start you have to set res in fibonacci function (to 0 I assume)
0
Instead of fibonacci you generate triangular numbers (ignoring output from print(i))