Compare commits

...

3 Commits
main ... main

Author SHA1 Message Date
d416039ffe pitite modifs 2024-11-26 10:59:52 +01:00
dc0d6c491a algo de tri pas opti du tou 2024-11-26 10:51:06 +01:00
37772a2de7 fichier réponses 2024-11-26 10:50:47 +01:00
2 changed files with 17 additions and 0 deletions

BIN
TD 4.docx Normal file

Binary file not shown.

17
tri.py Normal file
View File

@ -0,0 +1,17 @@
def function_tri(tableau):
for tab in tableau:
for i in range(1, len(tab)):
for i in range(1, len(tab)):
if tab[i] < tab[i-1]:
a = tab[i]
tab[i] = tab[i-1]
tab[i-1] = a
for i in range (1, len(tableau)):
for i in range (1, len(tableau)):
if tableau[i][0] < tableau[i][0]:
a = tableau[i]
tableau[i] = tableau[i-1]
tableau[i-1] = a
print(tableau)
function_tri([[4,0,3], [5,3,2], [3,6,5]])