diff --git a/s1_a53_6.py b/s1_a53_6.py index 144b10e..10ec606 100644 --- a/s1_a53_6.py +++ b/s1_a53_6.py @@ -22,12 +22,14 @@ 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]: list_to_sort[row], list_to_sort[next_row] = list_to_sort[next_row], list_to_sort[row] - print("The sorted list" + str(list_to_sort)) + print("The sorted list " + str(list_to_sort)) # Aufgabe 6