input: Write a python function to generate Fibonacci sequence up to a given number of terms.
  assert fibonacci(5) == [0, 1, 1, 2, 3]
  assert fibonacci(7) == [0, 1, 1, 2, 3, 5, 8]
  assert fibonacci(10) == [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
output: def fibonacci(n):
      if n <= 0:
          return []
      elif n == 1:
          return [0]
      elif n == 2:
          return [0, 1]
      
      sequence = [0, 1]
      for _ in range(2, n):
          sequence.append(sequence[-1] + sequence[-2])
      return sequence