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