input: Write a function to generate a Fibonacci sequence of given length and return it as a list.
  assert generate_fibonacci(5) == [0, 1, 1, 2, 3]
  assert generate_fibonacci(7) == [0, 1, 1, 2, 3, 5, 8]
  assert generate_fibonacci(0) == []
  assert generate_fibonacci(1) == [0]
output: def generate_fibonacci(length):
      if length == 0:
          return []
      if length == 1:
          return [0]
      fib = [0, 1]
      for i in range(2, length):
          fib.append(fib[-1] + fib[-2])
      return fib