python defaultdict

from collections import defaultdict

 

使用defaultdict设置默认值

defaultdict 对参数为python 中对list 、 str、 set、 int 等常见参数

而且支持匿名函数

my_defaultdict = defaultdict(lambda: [])

  

posted @ 2022-04-06 14:04  IVWT  阅读(42)  评论(0)    收藏  举报