CBSE Class 11 Informatics Practices
Question 6 of 80
Lists in Python — Question 6
Back to all questions 6
Question Assertion (A): sort() method sorts the objects of list in ascending order.
Reasoning (R): Defining sort() method with reverse=True as an argument sorts the list elements in descending order.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Both A and R are true and R is the correct explanation of A.
Explanation
The sort() function sorts the items of the list, by default in ascending/increasing order. If we want to sort the list in decreasing order, we need to write: sort(reverse = True).