input: Write a function to sort a list of numbers in ascending order using the selection sort algorithm. The function should take a list of integers as input and modify it in place. Return the sorted list.
  assert sort_list([4, 2, 6, 7, 1])==[1, 2, 4, 6, 7]
  assert sort_list([9, 3, 1, 7, 5])==[1, 3, 5, 7, 9]
  assert sort_list([])==[]
  assert sort_list([1])==[1]
  assert sort_list([2, 2, 2, 2])==[2, 2, 2, 2]
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