def selection_sort(collection):
 length = len(collection)
 for i in range(length):
  least = i
  for k in range((i + 1), length):
   if (collection[k] < collection[least]):
    least = k
  (collection[least], collection[i]) = (collection[i], collection[least])
 return collection

def selection_sort ( collection ) : length = len ( collection ) for i in range ( length ) : least = i for k in range ( ( i + 1 ) , length ) : if ( collection [ k ] < collection [ least ] ) : least = k ( collection [ least ] , collection [ i ] ) = ( collection [ i ] , collection [ least ] ) return collection
pure implementation of the selection sort algorithm in python .