运行 ❯
获取
你自己的 Python
服务器
×
更改方向
更改主题,深色/浅色
转至 Spaces
myfamily = { "child1" : { "name" : "Emil", "year" : 2004 }, "child2" : { "name" : "Tobias", "year" : 2007 }, "child3" : { "name" : "Linus", "year" : 2011 } } for x, obj in myfamily.items(): print(x) for y in obj: print(y + ':', obj[y])
child1 name: Emil year: 2004 child2 name: Tobias year: 2007 child3 name: Linus year: 2011