from collections import defaultdictfrom collections import namedtuple 转载于:https://www.cnblogs.com/morganh/p/10516400.html