"seance5_4h/formes.py" did not exist on "a6b6c2a7922db7e44a140113a01bfd138fcbff5a"
Select Git revision
INF-TC1-td04.ipynb
Forked from
Vuillemot Romain / INF-TC1
Source project has a limited visibility.
-
Romain Vuillemot authoredRomain Vuillemot authored
tri-bulle.py 358 B
def tri_bulle_iteratif(lst):
""" Tri par bulle """
taille = len(lst)
for i in range(taille-1) :
for j in range(i+1, taille) :
if lst[i] > lst[j] :
lst[i] , lst[j] = lst[j] , lst[i] # permutaion
return lst
liste=[1,3,13,4,7,2,9,2,18]
print(tri_bulle_iteratif(liste))
# [1, 2, 2, 3, 4, 7, 9, 13, 18]