def maxIndex(J):
    return J.index(max(J))

def swap(LCopy, i, j):
    temp = LCopy[i]
    LCopy[i] = LCopy[j]
    LCopy[j] = temp

# Implementation of selection sort
def selectionSort(L):
    for i in range(len(L)-1, 1, -1):
        j = maxIndex(L[0:i+1])
        swap(L, i, j)
        
L = [8, 4, 3, 1, 13, 11, 14, 1, 9, 324]
selectionSort(L)
print L