input: Write a function that generates a python program to sort a list of numbers using the selection sort algorithm. The function should take an array as input, sort it in place, and return the sorted array. If the input array is empty, the function should return the empty array.
  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([3, 5, 10, 1, 2])==[1, 2, 3, 5, 10]
  assert sort_list([4, 3, 1, 2])==[1, 2, 3, 4]
  assert sort_list([3, 5, 4, 1, 2])==[1, 2, 3, 4, 5]
  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]
      return array