python怎么生成一个嵌套字典,不想使用defaultdict实现

0
Python C/C++ 嵌套字典 36613 次浏览

比如原生的dict属性

test=dict()
test['a']=1         # 这个可以实现
test['x']['y']=2    # 这个就会报错

我想生成一个递归字典,如果没有这个键则创建,哪种方法能简洁点,优雅点~~多谢了

请尽量让自己的答案能够对别人有帮助

146个答案

默认排序 按投票排序
0

  is really informative! Thank you form จีคลับ

0

I wanna know more about this because this is really informative! best tummy tuck in tampa

0

I highly appreciate your work here! Thank you so much!

best tummy tuck in chicago

0

I love your content! Great job!

best tummy tuck in boise

0

Great site thanks admin. More power.  
https://breastaugmentationportlandor.com

0

 Nice blog and absolutely outstanding.  You can do something much better but i still say this perfect. Keep trying for the best. decking orlando

0

这是我的王国来了 financialadvisorsanjose.com

0

在你第一次去洛杉矶旅行 kitchenremodelinggrandrapids.com

1 2 3 4 5 6 7 8