def selection_sort(list): """ This function takes a list as parameter and sorts it using the selection sort strategy. That is, it goes through the list element by element, finds the position of the smallest element in the list right of the current element and swaps those two elements. """ for i in range(0, len(list)): min = i for j in range(i + 1, len(list)): if list[j] < list[min]: min = j list[i] = list[min] list[min] = list[i] return list