This program uses the Counter class from the collections module in Python. It creates a Counter object x using the dictionary {'Tamil':92, 'Math':88,'Science':89, 'Social':89, 'English':56}. The most_common method is then used on the Counter object, which returns a list of tuples where each tuple is a key-value pair from the Counter object in the order of their count, from the most common to the least. The returned list contains the elements and their count in the Counter object.
from collections import Counter x = Counter({'Tamil':92, 'Math':88,'Science':89, 'Social':89, 'English':56}) print(x.most_common())
[('Tamil', 92), ('Science', 89), ('Social', 89), ('Math', 88), ('English', 56)]
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions