Debian Codegraph @

texmf-dist/doc/fonts/monaspace-otf/samplemonaspacepython.py

raw
1 def Fibonacci(n: int) -> int :
2 # Check if input is 0 then it will print incorrect input
3 if n < 0 :
4 print("Incorrect input")
5 elif n == 0 :
6 return 0
7 elif 1 <= n <= 2 :
8 return 1
9 else :
10 return Fibonacci(n-1) + Fibonacci(n-2)