定义字典

familyinfo = {
"family name":"Python",
"family structure":[
{"name":"Taro", "age":32, "sex":"male"},
{"name":"Hanako", "age":31, "sex":"female"},
{"name":"Ichiro", "age":5, "sex":"male"}
],
"address":[
{"country":"Japan"},
{"administrative_area":"Tokyo"},
{"locality":"Chuohku"}
],
"phone number":"03-0000-0000"
}

想要打印“Taro”的话

print(familyinfo["family structure"][0]["name"])
05-28 02:45