input: Write a function to generate a list using a while loop in Python and append the current number to the list until a specified limit is reached. The function should return the generated list.
  assert generate_list([], 10)== [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  assert generate_list([3, 7, 9], 15)== [3, 7, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
  assert generate_list([], 0)== []
  assert generate_list([1, 2], -5)== [1, 2]
output: def generate_list(lst, limit):
      i = 0
      while i < limit:
          lst.append(i)
          i += 1
      return lst