input: Write a python function to generate a Fibonacci sequence of a given length and return it as a list.
  assert generate_fibonacci(6) == [0, 1, 1, 2, 3, 5]
  assert generate_fibonacci(1) == [0]
  assert generate_fibonacci(0) == 'Invalid length. Positive numbers only.'
  assert generate_fibonacci(3) == [0, 1, 1]
output: def generate_fibonacci(length):
      if length <= 0:
          return 'Invalid length. Positive numbers only.'
      elif length == 1:
          return [0]
      fibonacci_sequence = [0, 1]
      while len(fibonacci_sequence) < length:
          fibonacci_sequence.append(fibonacci_sequence[-1] + fibonacci_sequence[-2])
      return fibonacci_sequence[:length]