Commit 3e91470e by BellCodeEditor

save project

parent bad60c4c
Showing with 4 additions and 3 deletions
......@@ -6,10 +6,11 @@
# file1.write("李文:9\n")
# file1.write("张伟:16\n")
# file1.close()
with open(r"C:\\Users\\BBTC\\Desktop\\book.txt","a",encoding="utf-8")as file:
file.write("小兰:12\n")
file.write("小丽:11\n")
with open(r"C:\\Users\\BBTC\\Desktop\\book.txt","r",encoding="utf-8")as file:
for data in file:
if "小兰:12" in data:
print("在")
......
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