I have used the sorted
function in python3 with lists of lists in the past.
I noticed the following code does not work the way I intended
list1 = [[35, 48], [35, 47], [46, 13], [14, 11], [29, 45], [47, 48]]
sorted(list1)
print(list1)
My expectation for the output here would be to see
[[14, 11], [29, 45], [35, 47], [35, 48], [46, 13], [47, 48]]
but when I run this program in my terminal the output remains unchanged:
This is different than what conventional wisdom such as the comments in this answer say.
I am using Python 3.11.4 (main, Jun 7 2023, 00:46:41) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin