input: Write a function to generate a list using a while loop in Python and appends the current number to the list until the number reaches a certain limit. Return the generated list.
  def generate_list(limit):
      my_list = []
      num = 0
      while num < limit:
          my_list.append(num)
          num += 1
      return my_list
  assert generate_list(10)==[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  assert generate_list(5)==[0, 1, 2, 3, 4]
  assert generate_list(0)==[]
  assert generate_list(1)==[0]
  assert generate_list(3)==[0, 1, 2]
output: def generate_list(limit):
      my_list = []
      num = 0
      while num < limit:
          my_list.append(num)
          num += 1
      return my_list