Commit ba51a97e by BellCodeEditor

save project

parent 32c0b685
Showing with 6 additions and 5 deletions
......@@ -6,8 +6,9 @@ file.close()
with open(r'C:\Users\Administrator\Desktop\book.txt','w',encoding='utf-8')as file:
file.write('小强:12本\n李明:15本\n')
date="小强:12本"
if date in file:
print("数据已在了")
with open(r'C:\Users\Administrator\Desktop\book.text','r',encoding='utf-8')as file:
#file.write('小强:12本\n李明:15本\n')
for i in file:
print(i)
if '小强:12本' in i:
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