input: def fibonacci(n): 
      a = 0
      b = 1
      if n < 0: 
          print("Incorrect input") 
      elif n == 0: 
          return a 
      elif n == 1: 
          return b 
      else: 
          for i in range(2,n): 
              c = a + b 
              a = b 
              b = c 
          return b 
  
  # Example:
  # for fibonacci(9) == 21
  # for fibonacci(1) == 1
  # for fibonacci(0) == 0
output:     for i in range(2, n+1): 
          c = a + b 
          a = b 
          b = c 
      return b