input: Write a function to implement a sorting algorithm that sorts a list in ascending order. The function should iterate through the list and place the smallest element at the current position. It should return the sorted list.
  
  def sort_list(mylist):
      for i in range(len(mylist)):
          min_index = i
          temp = mylist[i]
          for j in range(i + 1, len(mylist)):
              if mylist[min_index] > mylist[j]:
                  min_index = j
          mylist[i] = mylist[min_index]
          mylist[min_index] = temp
      return mylist
  
  assert sort_list([1, 5, 7, 8, 4, 10, 2]) == [1, 2, 4, 5, 7, 8, 10]
  assert sort_list([3, 7, 1, 8, 2]) == [1, 2, 3, 7, 8]
  assert sort_list([]) == []
  assert sort_list([9, 9, 1, 1, 5, 5]) == [1, 1, 5, 5, 9, 9]
  assert sort_list([-1, -3, -2, -5]) == [-5, -3, -2, -1]
output: def sort_list(mylist):
      for i in range(len(mylist)):
          min_index = i
          temp = mylist[i]
          for j in range(i + 1, len(mylist)):
              if mylist[min_index] > mylist[j]:
                  min_index = j
          mylist[i] = mylist[min_index]
          mylist[min_index] = temp
      return mylist