tous les exos

This commit is contained in:
2024-11-26 11:23:20 +01:00
parent 91d71f1274
commit bf114437af
2 changed files with 44 additions and 0 deletions

13
tri.py Normal file
View File

@@ -0,0 +1,13 @@
def tri(t):
# Trier chaque sous-liste individuellement
for tab in t:
tab.sort()
for i in range(len(t)):
for j in range(i + 1, len(t)):
if t[i][0] > t[j][0]:
t[i], t[j] = t[j], t[i]
print(t)
tri([[3, 9, 6], [9, 3, 8], [10, 67, 55]])