Ad
Code
Diff
  • startNumber = int(raw_input("56 "))
    endNumber = int(raw_input("109 "))
    
    def fib(n):
        if n < 2:
            return n
        return fib(n-2) + fib(n-1)
    
    print map(fib, range(startnumber, endnumber))
    
    • def fibonacci(n, a=0, b=1):
    • if n == 0: return 0
    • if n == 1: return b
    • else:
    • return fibonacci(n-1, b, a+b)
    • startNumber = int(raw_input("56 "))
    • endNumber = int(raw_input("109 "))
    • def fib(n):
    • if n < 2:
    • return n
    • return fib(n-2) + fib(n-1)
    • print map(fib, range(startnumber, endnumber))