input: Write a function to calculate the Fibonacci sequence up to the nth term. The function should return the nth Fibonacci number. If n is less than 0, the function should print "Incorrect input" and return None. If n is 0, it should return 0. If n is 1, it should return 1. If n is greater than 1, it should return the Fibonacci number at the nth position.
  def fibonacci(n): 
      if n < 0: 
          print("Incorrect input") 
          return None
      elif n == 0: 
          return 0
      elif n == 1: 
          return 1
      else: 
          a, b = 0, 1
          for _ in range(2, n + 1): 
              c = a + b 
              a, b = b, c 
          return b 
  
  # Test cases
  assert fibonacci(0) == 0
  assert fibonacci(1) == 1
  assert fibonacci(2) == 1
  assert fibonacci(9) == 34
  assert fibonacci(-1) == None
output: def fibonacci(n): 
      if n < 0: 
          print("Incorrect input") 
          return None
      elif n == 0: 
          return 0
      elif n == 1: 
          return 1
      else: 
          a, b = 0, 1
          for _ in range(2, n + 1): 
              c = a + b 
              a, b = b, c 
          return b