Write a function to sort a list of integers using a specific algorithm.
For this exercise, use selection sort and do not call Python's built-in sorting functions. Define selection_sort(nums) to accept a list of integers and return the same list sorted in ascending order. The function should modify the list in place and return it.
nums, a list of integers.def selection_sort(nums):