input: Write a function to calculate the Fibonacci numbers up to a given number, and return a list of these numbers. The function should take an integer `n` as input, and return a list containing the Fibonacci sequence up to `n`. If `n` is 0, the function should return `[0]`. If `n` is 1, the function should return `[0, 1]`. For any other value of `n`, the function should calculate the Fibonacci sequence up to and including `n`. 
  assert Fibonacci(0)==[0]
  assert Fibonacci(1)==[0, 1]
  assert Fibonacci(5)==[0, 1, 1, 2, 3, 5]
  assert Fibonacci(10)==[0, 1, 1, 2, 3, 5, 8]
  assert Fibonacci(1)==[0, 1]
output: def Fibonacci(n):
      if n == 0:
          return [0]
      elif n == 1:
          return [0, 1]
      else:
          fib_sequence = [0, 1]
          while fib_sequence[-1] <= n:
              next_fib = fib_sequence[-1] + fib_sequence[-2]
              if next_fib > n:
                  break
              fib_sequence.append(next_fib)
          return fib_sequence