input: Write a python function to generate the Fibonacci sequence up to a given number n.
  assert generate_fibonacci(100) == [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
  assert generate_fibonacci(10) == [0, 1, 1, 2, 3, 5, 8]
  assert generate_fibonacci(1) == [0, 1]
output: def generate_fibonacci(n):
      if n < 0:
          return []
      fib_sequence = [0, 1]
      while True:
          next_fib = fib_sequence[-1] + fib_sequence[-2]
          if next_fib > n:
              break
          fib_sequence.append(next_fib)
      return fib_sequence