input: Write a function to sort a list of numbers using the selection sort algorithm. The function should take a list of numbers as input and return the sorted list. 
  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(nums):
      for i in range(len(nums)):
          min_idx = i
          for j in range(i+1, len(nums)):
              if nums[j] < nums[min_idx]:
                  min_idx = j
          nums[i], nums[min_idx] = nums[min_idx], nums[i]
      return nums