L = [ 8 , 6 , 2 , 2 , 9 , 2 , 7 , 10 ]
for i in range(len(L)):
    m = L[i]
    indice = i
    for j in range(i+1,len(L)):
        if L[j] < m:
            m = L[j]
            indice = j
    a = L[i]
    L[i] = L[indice]
    L[indice] = a

if len(L) % 2 == 1:
    mediane = L[ len(L) // 2 ]
else:
    mediane = ( L[ len(L) // 2 ] + L[ len(L) // 2 + 1 ] ) / 2

print(L)
print('Médiane : ',mediane)
