Sorting


#1

What is difference between ‘Sorted’ and ‘list.sort()’ ? Which one is better to use and in which condtion ?


#2

.sort() is only for lists, and modifies the original list, while sorted() can also be used for strings for example, and returns a new list.