Ai
1 Star 2 Fork 4

peiss/ant-python-exercises-100p

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
p086.py 414 Bytes
一键复制 编辑 原始数据 按行查看 历史
crazyant 提交于 2022-05-21 11:28 +08:00 . 'xx'
grade_dict = {}
with open("p086_grade.txt", encoding="utf8") as f:
for line in f:
sno, grade = line.strip().split(",")
grade_dict[sno] = grade
print(grade_dict)
fout = open("p086.txt", "w", encoding="utf8")
with open("p086_student.txt", encoding="utf8") as f:
for line in f:
sno, sname = line.strip().split(",")
grade = grade_dict[sno]
fout.write(f"{sno},{sname},{grade}\n")
fout.close()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/antpython/ant-python-exercises-100p.git
git@gitee.com:antpython/ant-python-exercises-100p.git
antpython
ant-python-exercises-100p
ant-python-exercises-100p
master

搜索帮助