saving . . . saved reversing list issue has been deleted. reversing list issue has been hidden .
reversing list issue
Title
Question
we have used sorted(marks,reverse=True)
why can't we use marks.sort(reverse=True) to perform changes in marks itself ?

Python-3.4.3 Manipulating-lists 08-09 min 30-40 sec 22-09-20, 6:05 p.m. iampiyushgupta@gmail.com

Answers:

Both are correct ways to do reversal. The difference is that .sort will sort the list in place while sorted will create a new list.
24-09-20, 11:56 a.m. ankitrj.iitb


Log-in to answer to this question.