weixin_慕前端1126109
2022-04-25 16:44
OpenFile = open("source.txt","r")
lines = OpenFile.readlines()
CreateFile = open("target.txt","w")
for i in lines:
Ri = i[::-1]
if lines.index(i) == -1:
break
Ri = Ri.strip()
Ri = Ri+"\n"
CreateFile.write(Ri)
OpenFile.close()
CreateFile.close()
确实如此
Python3 进阶教程(新版)
41910 学习 · 236 问题
相似问题