Commit 0f6de1cd by BellCodeEditor

save project

parent f3452ee1
Showing with 13 additions and 0 deletions
with open(r"C:\Users\Administrator\Documents\a.txt",'w',encoding='utf-8')as file:
file.write("小兰:12本")
file.write("小强:10本")
file.close()
with open(r"C:\Users\Administrator\Documents\a.txt",'r',encoding='utf-8')as file:
file.read()
for i in file:
if "小兰:12本" in file:
print("有小兰")
if "小强:10本" in file:
print("有小强")
file.close()
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