input: Write a function to implement a selection sort algorithm in Python that takes a list of integers as input and outputs the list sorted in ascending order. If the input list is empty, return an empty list.
  
  def sort_ascending(nums):
      for i in range(len(nums)):
          min_idx = i
          for j in range(i + 1, len(nums)):
              if nums[min_idx] > nums[j]:
                  min_idx = j
          nums[i], nums[min_idx] = nums[min_idx], nums[i] 
      return nums
  
  assert sort_ascending([4, 2, 1, 3]) == [1, 2, 3, 4]
  assert sort_ascending([7, 3, 5, 2, 8]) == [2, 3, 5, 7, 8]
  assert sort_ascending([9, 8, 7, 6, 5]) == [5, 6, 7, 8, 9]
  assert sort_ascending([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]
  assert sort_ascending([]) == []
output: def sort_ascending(nums):
      for i in range(len(nums)):
          min_idx = i
          for j in range(i + 1, len(nums)):
              if nums[min_idx] > nums[j]:
                  min_idx = j
          nums[i], nums[min_idx] = nums[min_idx], nums[i] 
      return nums