Commit 7baefcba by BellCodeEditor

save project

parent 3fc6bfb3
Showing with 7 additions and 2 deletions
......@@ -7,4 +7,9 @@ file1.write("张伟:16本\n")
file1.close()
with open(r"C:\Users\ColaMaster\Desktop\cola.txt","a",encoding="utf-8") as file2:
file2.write("大兰:200本\n")
\ No newline at end of file
file2.write("大兰:200本\n")
with open(r"C:\Users\ColaMaster\Desktop\cola.txt","r",encoding="utf-8") as file3:
for data in file3:
if "大兰:200本\n" in data:
print("找到了")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment