what is the difference between sort() and sorted() functions in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what is the difference between sort() and sorted() functions in python?

10th Jul 2020, 3:24 PM
Sahil Aujla
Sahil Aujla - avatar
5 Answers
+ 4
The difference is,sort() is a function with no return value,it sorts the list and modifies the given list while sorted() function returns a new list with sorted elements of the given list
10th Jul 2020, 3:28 PM
Anjali Priya
Anjali Priya - avatar
+ 1
Anjali Priya thank you so much ๐Ÿ˜Š๐Ÿ˜Š
10th Jul 2020, 3:30 PM
Sahil Aujla
Sahil Aujla - avatar
0
Arnesh thanks
10th Jul 2020, 3:40 PM
Sahil Aujla
Sahil Aujla - avatar
0
๐Ÿ˜ŠWelcome
10th Jul 2020, 3:45 PM
Arnesh
Arnesh - avatar