How to construct a defaultdict from a dictionary?

后端 未结 3 529
挽巷
挽巷 2021-02-06 19:57

If I have d=dict(zip(range(1,10),range(50,61))) how can I build a collections.defaultdict out of the dict?

The only argument

3条回答
  •  梦谈多话
    2021-02-06 20:50

    defaultdict is a method from collections which does not return key error when element is not present.

提交回复
热议问题