import json
with open('select_json.json', 'r') as file:
data = json.load(file)
score = data['score']
for item in score:
question_id = item['id']
title = item['title']
answers = item['answer']
for ans in answers:
option = ans['tit']
answer = ans['ans']
print(f"ID: {question_id}, title: {title}, option: {option}, answer: {answer}")
python中json数据的处理
最新推荐文章于 2024-08-24 11:00:49 发布