Commit 3c25762d by BellCodeEditor

save project

parent ee207a1a
Showing with 9 additions and 3 deletions
with open(r'C:\Users\Administrator\Desktop\kun.txt','a',encoding='utf-8') as file: #with open(r'C:\Users\Administrator\Desktop\kun.txt','a',encoding='utf-8') as file:
file.write("\n小强:12本、\n李明:15本、") #file.write("\n小强:12本、\n李明:15本、")
\ No newline at end of file with open(r'C:\Users\Administrator\Desktop\kun.txt','r',encoding='utf-8') as file:
for i in file:
if "两年半" in i:
print("坤坤找到了")
else:
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