input: Write a function to sort a list of numbers using the selection sort algorithm. If the input list is already sorted, it should return the list without any changes. If the input list is empty, it should return an empty list.
  assert sort_list([4, 2, 6, 7, 1])==[1, 2, 4, 6, 7]
  assert sort_list([1, 2, 3, 4, 5])==[1, 2, 3, 4, 5]
  assert sort_list([5, 4, 3, 2, 1])==[1, 2, 3, 4, 5]
  assert sort_list([])==[]
  assert sort_list([7])==[7]
output: def sort_list(lst):
      if not lst:
          return lst
      n = len(lst)
      for i in range(n):
          min_idx = i
          for j in range(i+1, n):
              if lst[j] < lst[min_idx]:
                  min_idx = j
          lst[i], lst[min_idx] = lst[min_idx], lst[i]
      return lst