0

What does Sort and Reverse do in Python?

when Doing a list what does Sort do

3rd Jan 2018, 5:50 PM
Carlos Tealdo
Carlos Tealdo - avatar
1 Resposta
+ 2
Sort, get the elements of list, compare 'em all n arrange them in a sorted manner i.e., ascending or descending. Reverse, get all the elements of list and swap their positions front to back i.e., the element or value in first position of list will go back to the last position and the 2nd will go to the 2nd last position and so on...
3rd Jan 2018, 6:48 PM
Harjeet Singh
Harjeet Singh - avatar