14 lines
303 B
Python
14 lines
303 B
Python
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]])
|