Aufgabe 5 alternative Lambda Funktion implementiert

main
Thore Eichhorn 2022-11-11 21:06:58 +01:00
parent 1d12195402
commit b9ee7f2538
1 changed files with 3 additions and 1 deletions

View File

@ -22,6 +22,8 @@ if __name__ == "__main__":
# Aufgabe 5
list_to_sort = [[1, 2, 3], [2, 1, 3], [4, 0, 1]]
list_to_sort.sort(key=lambda x: x[1]) # in-build-function
for row in range(len(list_to_sort)):
for next_row in range(row + 1, len(list_to_sort)):
if list_to_sort[row][1] > list_to_sort[next_row][1]: