input: Write a python function to generate the nth number in the Fibonacci series.
  assert generate_fibonacci(1) == 1
  assert generate_fibonacci(2) == 1
  assert generate_fibonacci(8) == 21
  assert generate_fibonacci(10) == 55
output: def generate_fibonacci(n):
      if n <= 0:
          return 0
      elif n == 1 or n == 2:
          return 1
      else:
          a, b = 1, 1
          for _ in range(3, n + 1):
              a, b = b, a + b
          return b