Question DSA-SORT-0040
EasyIn Python, how does list.sort() differ from sorted()?
- A.
sorted() works only on numbers
- B.
There is no difference
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Sorting question
In Python, how does list.sort() differ from sorted()?
sorted() works only on numbers
There is no difference
Sign up free to see the answer and a step-by-step explanation.
list.sort() sorts the list in place; sorted() returns a new sorted list
list.sort() returns a new list