input: Write a function to sort a list of numbers using selection sort algorithm. The function should iterate through the list and find the smallest element and swap it with the current element. If the input list is empty, it should return an empty list.
  
  def sort_list(array):
      n = len(array)
      for i in range(n):
          min_idx = i
          for j in range(i+1, n):
              if array[min_idx] > array[j]:
                  min_idx = j
          array[i], array[min_idx] = array[min_idx], array[i]
  
  assert sort_list([4, 2, 6, 7, 1])==[1, 2, 4, 6, 7]
  assert sort_list([5, 3, 8, 6, 7, 2])==[2, 3, 5, 6, 7, 8]
  assert sort_list([])==[]
output: def sort_list(array):
      n = len(array)
      for i in range(n):
          min_idx = i
          for j in range(i+1, n):
              if array[min_idx] > array[j]:
                  min_idx = j
          array[i], array[min_idx] = array[min_idx], array[i]