u am starting to learn python, and want to get some experience with functions , for instance i have wrote following simple code in python
def fibonacci(n):
if n == 1:
return 1
elif n == 2:
return 1
elif n > 2:
return fibonacci(n-1)+fibonacci(n-2)
for n in range(1, 4):
print(n,", ",fibonacci(n))
but when i have run this code, i am getting just this line
C:\Users\Dato\Desktop\Python_codes\venv\Scripts\python.exe C:/Users/Dato/Desktop/Python_codes/fibonacci.py
Process finished with exit code 0
so why does not it shows me result?
forloop is inside the function.returnfinishes the function here.