Advertisement
Zapped

Fibonacci function

Apr 12th, 2021
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.09 KB | None | 0 0
  1. def fib(n):
  2.     if n==0:
  3.         return 0
  4.     elif n==1:
  5.         return 1
  6.     else:
  7.         return fib(n-1)+fib(n-2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement