input: Write a function to generate a list using a while loop in Python and appends the current number to the list. Ensure the list starts from 0 and ends at 9.
  assert generate_list() == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
output: def generate_list():
      result = []
      i = 0
      while i <= 9:
          result.append(i)
          i += 1
      return result