在字典中查找项目

时间:2015-05-23 02:23:35

标签: python dictionary nested

我希望从以下值中获取student_id的值,但我不确定如何,因为该值在嵌套dict内。我怎样才能到达student_id

{
    "specification": {
        "[student_id]": {
            "grade_level": "numeric grade level between 1 and 6",
            "score": "Test score, numeric, between 1 and 4",
            "school_id": "school id"
        }
    },
    "data": {
        "1": {
            "grade_level": 1,
            "score": 3,
            "school_id": "PS0001"
        },
        "2": {
            "grade_level": 1,
            "score": 4,
            "school_id": "PS0001"
        }
    }
}

到目前为止,我已经尝试了

['specification'].keys()

0 个答案:

没有答案