**
1.collections.defaultdict()的使用
**
使用collections类中的defaultdict()方法来为字典提供默认值。
传送门:https://blog.csdn.net/yangsong95/article/details/82319675
**
2.使用sorted函数对字典按key排序和按value排序
**
sorted(iterable,key,reverse)
字典:s = [[“e”,2],[“r”,1],[“t”,1]]
按key:sorted(s.key())
按value:sorted(s.item(),key=lambda key:key[1])
默认为升序,若要改为降序,可加reverse=True
传送门:https://blog.csdn.net/tangtanghao511/article/details/47810729