如何创建嵌套的Python字典?
字典对象是可变的。因此,一个字典对象可以用作键的值组件。因此,我们可以创建一个嵌套的字典对象,将另一个字典对象定义为与键关联的值。
>>> students={"student1":{"name":"Raaj", "age":23, "subjects":["Phy", "Che", "maths"],"GPA":8.5},"student2":{"name":"Kiran", "age":21, "subjects":["Phy", "Che", "bio"],"GPA":8.25}}
以上是 如何创建嵌套的Python字典? 的全部内容, 来源链接: utcz.com/z/338398.html