Commit b71dba02 by BellCodeEditor

save project

parent 94cedaab
Showing with 7 additions and 5 deletions
with open(r"C:\Users\xuank\Desktop\diy.txt",'w',encoding='utf-8') as word:
word.write("小兰:20本\n")
word.write("小强:19本\n")
word.write("李明:10本\n")
word.write("小丽:39本\n")
with open(r"C:\Users\xuank\Desktop\diy.txt",'r',encoding='utf-8') as word:
for i in word:
if "小强:10" 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