input: Write a function to demonstrate a sorting algorithm using selection sort. The function should take a list as input and return the sorted list in non-decreasing order. If the input list is empty, it should return an empty 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, 6, 2, 9, 1, 5]) == [1, 2, 3, 5, 6, 9]
  assert sort_list([10, 8, 4, 6, 2]) == [2, 4, 6, 8, 10]
  assert sort_list([]) == []
output: def sort_list(mylist):
      for i in range(len(mylist)):
          min_index = i
          for j in range(i + 1, len(mylist)):
              if mylist[j] < mylist[min_index]:
                  min_index = j
          mylist[i], mylist[min_index] = mylist[min_index], mylist[i]
      return mylist