Ad
Code
Diff
  • def fibonacci(x):
        if x == 0 or x == 1:
            return x
        else :
            return fibonacci(x-1) + fibonacci(x-2)
    
    • def fibonacci(x):
    • if x == 0:
    • return 0
    • elif x == 1:
    • return 1
    • if x == 0 or x == 1:
    • return x
    • else :
    • return fibonacci(x-1) + fibonacci(x-2)