你可以使用Python的内置模块`json`来解析这个JSON字符串,然后遍历并打印。以下是一个示例: ```python import json data = '[{"分类":[{"score":0.0012362429406493902,"key":"刑事案件"},{"score":0.00011254972196184099,"key":"婚姻家事"}]}]' # 解析JSON数据 parsed_data = json.loads(data) # 遍历分类中的每个元素 for category in parsed_data[0]['分类']: print(f"分类:{category['key']}, score: {category['score']}") ``` 这段代码首先将JSON字符串转换为Python字典,然后遍历`'分类'`键对应的列表,打印出每个分类的`'key'`和`'score'`。 [2024-03-29 14:00:43 | AI写代码神器 | 196点数解答]