input: Write a function to demonstrate a sorting algorithm that takes a list as input and returns the sorted list. Use the selection sort algorithm to achieve this. 
  assert sort_list([1, 5, 7, 8, 4, 10, 2])==[1, 2, 4, 5, 7, 8, 10]
  assert sort_list([])==[]
  assert sort_list([5, 2, 9, 1, 5, 6])==[1, 2, 5, 5, 6, 9]
  assert sort_list([3, 3, 3, 3])==[3, 3, 3, 3]
  assert sort_list([-1, -3, 0, -2])==[-3, -2, -1, 0]
output: def sort_list(lst):
      for i in range(len(lst)):
          min_idx = i
          for j in range(i+1, len(lst)):
              if lst[j] < lst[min_idx]:
                  min_idx = j
          lst[i], lst[min_idx] = lst[min_idx], lst[i]
      return lst