预测工具片段的输出
运行下面的 Python 3 程序,填写结果。
import json
rows = [{"name": "小明", "score": "80"},
{"name": "小红", "score": "90"}]
total = 0
for r in rows:
total = total + int(r["score"])
print(json.dumps({"total": total}, ensure_ascii=False))
运行下面的 Python 3 程序,填写结果。
import json
rows = [{"name": "小明", "score": "80"},
{"name": "小红", "score": "90"}]
total = 0
for r in rows:
total = total + int(r["score"])
print(json.dumps({"total": total}, ensure_ascii=False))
全部评论