To sort a dictionary in descending order set reverse = TRUE as the second argument of the sorted() method.

 

Answer:

  • The sorted() function is used to return a sorted list of the items in an iterable object in Python. 
  • The sorted() function can also take other parameters to customize the sorting behavior, such as reverse, which specifies whether to sort in ascending or descending order, and key, which specifies a function that returns the value to be compared for each item.
  • The reverse parameter is a boolean value that can be either True or False. If reverse is set to True , the sorted() function will sort the items in descending order, meaning from largest to smallest or from Z to A.
  •  If reverse is set to False or omitted, the sorted() function will sort the items in ascending order, meaning from smallest to largest or from A to Z.

So, the given statement is true.

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo