Python中的sorted函数以及operator.itemgetter函数

operator.itemgetter函数 operator模块提供了itemgetter()函数,能够经过指定该函数的参数(参数表明维度)来获取对象的相应维度的数据,能够经过一个例子看一下:python from operator import itemgetter direction = ['west', 'south', 'north', 'east'] desc1 = itemgette
相关文章
相关标签/搜索