Search through the list until you find the smallest item, then move that smallest item to the start of the list. That start of the list is now the sorted section, and anything not sorted is to the right.
Implementation
for i in range(len(inputlist)):
# find the index of smallest item
index_of_smallest = inputlist.index(min(inputlist))
L[index_of_smallest], L[i] = L[i], L[index_of_smallest]
C Implementation
void select_sort(int *arr, int size){
for (int i = 0; i < size; i ++)
{
int mini = i;
for(int j = i; j < size; j++){
if (arr[j] < arr[mini]){
mini = j;
}
}
int minicpy = arr[mini];
arr[mini] = arr[i];
arr[i] = minicpy;
}
}