TIL — Python Sorting Lists — list.sort() vs sorted(list)
The 2 common ways to sort a list in Python are inputList.sort()
or sorted(inputList)
.
Well, inputList.sort()
sorts the list in place, in other words, you loose the original list because it will be mutated to…