Ad
Code
Diff
  • def fibonacci(b):
        if b in [0, 1]: return b 
        return fibonacci(b-1) + fibonacci(b-2)
    
    • def fibonacci(b):
    • if b == 0:
    • return 0
    • elif b == 1:
    • return 1
    • else :
    • return fibonacci(b-1) + fibonacci(b-2)
    • if b in [0, 1]: return b
    • return fibonacci(b-1) + fibonacci(b-2)