Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 311 Bytes

operator.md

File metadata and controls

12 lines (8 loc) · 311 Bytes

Operator Module

This module helps to sort the item based on the specific item in the list or disctionary.

import operator 

sorted(fruit.items(), key=operator.itemgetter(0))

sorted(fruit.items(), key=operator.itemgetter(1))

sorted(fruit.items(), key = operator.itemgetter(1), reverse=True)