The 'reverse( )' Function is used to reverse a List. It is independent of the alphabets or numbers.
And is not a sort. It is just a reversal.
x = ["Mohan", "Kriti", "Salim"] x.reverse() print("The List in reversed order is ",x)
So, in the above code we have created a 'List' and initialised to the variable 'x'.
Below is how the values are positioned in the List,
Then we have used the 'reverse( )' Function to reverse the elements of the List 'x'.
And the List 'x' gets sorted in descending order with 'Salim' as the first value, 'Mohan' second and 'Kriti' as the third.
And we get the below output.