input: Write a function to generate a list by using a while loop in Python, appending the current number to the list until the number reaches a specified maximum value.
  assert append_numbers_to_list([], 10)==[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  assert append_numbers_to_list([1], 10)==[1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  assert append_numbers_to_list([], 0)==[]
  assert append_numbers_to_list([5, 5], 5)==[5, 5]
  assert append_numbers_to_list([2, 3], 2)==[2, 3]
output: def append_numbers_to_list(lst, max_val):
      i = 0
      while i < max_val:
          lst.append(i)
          i += 1
      return lst