标签:ar sp on bs as nbsp python br class
--------------
>>> a {‘a‘: 5, ‘c‘: 3, ‘b‘: 4, ‘e‘: 1, ‘d‘: 2} >>> sorted(a.items()) [(‘a‘, 5), (‘b‘, 4), (‘c‘, 3), (‘d‘, 2), (‘e‘, 1)] >>> sorted(aa.items(),key = lambda d:d[1]) [(‘e‘, 1), (‘d‘, 2), (‘c‘, 3), (‘b‘, 4), (‘a‘, 5)] >>> sorted(aa.items(),key = lambda d:d[1],reverse=True) [(‘a‘, 5), (‘b‘, 4), (‘c‘, 3), (‘d‘, 2), (‘e‘, 1)]
标签:ar sp on bs as nbsp python br class
原文地址:http://my.oschina.net/jk409/blog/352413