Python怎么将一个字典添加到另一个新字典中?

1 个回答|78 次阅读
Coco老师 - 科普专家
擅长:编程教育
dict1 = {
  "name" : "lili",
  "year" : 2004
}
dict2 = {
  "name" : "tiantian",
  "year" : 2007
}
dict3 = {
  "name" : "ruirui",
  "year" : 2011
}
myfamily = {
  "child1" : dict1,
  "child2" : dict2,
  "child3" : dict3
}