def tri_insertion(lst): for indice_Courant in range(1, len(lst)): element_A_Inserer = lst[indice_Courant] i = indice_Courant - 1 while i >= 0 and lst[i] > element_A_Inserer: lst[i + 1] = lst[i] i = i - 1 lst[i + 1] = element_A_Inserer
Create, edit, and import your Python scripts
def tri_insertion(lst): for indice_Courant in range(1, len(lst)): element_A_Inserer = lst[indice_Courant] i = indice_Courant - 1 while i >= 0 and lst[i] > element_A_Inserer: lst[i + 1] = lst[i] i = i - 1 lst[i + 1] = element_A_Inserer