input: Write a python function to generate the Fibonacci sequence up to the nth number.
  assert generate_fibonacci(10)==[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
  assert generate_fibonacci(5)==[0, 1, 1, 2, 3, 5]
  assert generate_fibonacci(0)==[0]
  assert generate_fibonacci(1)==[0, 1]
output: def generate_fibonacci(n):
      if n == 0:
          return [0]
      elif n == 1:
          return [0, 1]
      
      fib_sequence = [0, 1]
      for i in range(2, n + 1):
          fib_sequence.append(fib_sequence[-1] + fib_sequence[-2])
      return fib_sequence