1 json_str={ 2 "actor":"鄧超", 3 "age":35, 4 "book":[ 5 "英語", 6 "數學", 7 "美術" 8 ], 9 "children":[ 10 { 11 "name":"等等", 12 "age":7, 13 "sex":"male" 14 }, 15 { 16 "name":"花花", 17 "age":3, 18 "sex":"female" 19 } 20 ] 21 } 22 23 24 25 #獲取actor 的值 26 actor=json_str['actor'] 27 #獲取 book 的第二個值 28 book_2=json_str['book'][1] 29 #獲取第二個孩子的性別 30 sex2=json_str['children'][1]['sex']