input: Write a python function to generate a Fibonacci sequence up to a given number n.
  assert fibonacci(10) == [0, 1, 1, 2, 3, 5, 8]
  assert fibonacci(15) == [0, 1, 1, 2, 3, 5, 8, 13]
  assert fibonacci(1) == [0]
output: def fibonacci(n):
      sequence = [0, 1]
      while True:
          next_value = sequence[-1] + sequence[-2]
          if next_value >= n:
              break
          sequence.append(next_value)
      return sequence[:1] if n == 1 else sequence