Selection sorting is conceptually the simplest sorting algorithm. This algorithm first finds the smallest element in the array and exchanges it with the element in the first position, then find the second smallest element and exchange it with the element in the second position, and continues in this way until the entire array is sorted.
We have a detailed tutorial covering How Selection sort works, and we strongly recommend you go through it to understand the functioning of the selection sort algorithm, before going over the code below.
We have used the python list for implementing the selection sorting technique. You can change the code, as you like.