diy.py 248 Bytes Edit 1 2 3 4 5 # 写入同学们的捐赠明细:'小兰:12本'、'小丽:11本'、'李文:9本'、'张伟:16本' f = open("d:/a.txt","w",encoding="utf-8") f.write('小兰:12本、小丽:11本、李文:9本、张伟:16本') f.close() print("end")