input: Write a function to generate the nth number in the Fibonacci sequence. If the input value is less than 0, return "Incorrect input". If the input value is 0 or 1, return 0 or 1 respectively. For any other input value, return the nth Fibonacci number.
  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
  
  # Testing the function
  assert fibonacci(0) == 0
  assert fibonacci(1) == 1
  assert fibonacci(2) == 1
  assert fibonacci(5) == 3
  assert fibonacci(9) == 21
output: def fibonacci(n):
      if n < 0:
          return "Incorrect input"
      elif n == 0:
          return 0
      elif n == 1:
          return 1
      else:
          a, b = 0, 1
          for _ in range(2, n + 1):
              a, b = b, a + b
          return b