PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
#You have to indent every time you use a loop or decision statement like for, while or if
num = int(input())
def fibonacci(n):
if n <= 1:
return 0
if n == 2 or n == 3:
return 1
else:
return fibonacci(n-1)+fibonacci(n-2)
fibonacci(num)
for i in range (num):
print (fibonacci(i+1))
#you missed to close the print statement
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run