input: Write a function to calculate the Fibonacci numbers up to a given number. The function should take an integer n as input and return a list of Fibonacci numbers up to the nth number.
  def fibonacci_up_to(n):
      if n < 0:
          return []
      fib_sequence = [0, 1]
      while len(fib_sequence) <= n:
          fib_sequence.append(fib_sequence[-1] + fib_sequence[-2])
      return fib_sequence[:n+1]
  
  assert fibonacci_up_to(0)==[0]
  assert fibonacci_up_to(1)==[0, 1]
  assert fibonacci_up_to(5)==[0, 1, 1, 2, 3, 5]
  assert fibonacci_up_to(10)==[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
output: def fibonacci_up_to(n):
      if n < 0:
          return []
      fib_sequence = [0, 1]
      while len(fib_sequence) <= n:
          fib_sequence.append(fib_sequence[-1] + fib_sequence[-2])
      return fib_sequence[:n+1]