compare_sort_methods(items) that returns a tuple (new_sorted, original_after). new_sorted is the result of calling sorted() on items (which must NOT mutate the input). original_after is the state of items right after calling .sort() on it in place. This demonstrates the difference between the two.items = [3, 1, 2]
([1, 2, 3], [1, 2, 3])
sorted() returns a new list without touching items; then .sort() mutates items in place — both end up sorted, but via different mechanisms.
Call sorted(items) first and store it.
Then call items.sort() which mutates items directly.