Commit 2c2f015e by BellCodeEditor

save project

parent 37bfaebc
Showing with 19 additions and 13 deletions
wert=open(r'C:\Users\Administrator\Desktop\test13.txt','a',encoding='utf-8')
wert.write('小兰:12\n')
wert.write("小丽:11本\n")
wert.write('李文:9本\n')
wert.write('张伟:16本\n')
wert.close()
with open(r'C:\Users\Administrator\Desktop\test12.txt','a',encoding='utf-8')as
file:
wert.write("小兰:12\n")
wert.write("小丽:11本\n")
wert.write('李文:9本\n')
wert.write('张伟:16本\n')
\ No newline at end of file
# wert=open(r'C:\Users\Administrator\Desktop\test13.txt','w',encoding='utf-8')
# wert.write('小兰:12本\n')
# wert.write("小强:10本\n")
# wert.write('李文:9本\n')
# wert.write('张伟:16本\n')
# wert.close()
with open(r'C:\Users\Administrator\Desktop\test13.txt','r',encoding='utf-8')as wert:
for i in wert:
if "小兰" in i:
print("找到了!")
if '小强:10本' in i:
print("找到了!")
# wert:
# wert.write("小兰:12本\n")
# wert.write("小丽:11本\n")
# wert.write('李文:9本\n')
# wert.write('张伟:16本\n')
\ 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