Commit 4ea74cc7 by BellCodeEditor

save project

parent 7ae37078
Showing with 11 additions and 4 deletions
with open(r'C:\Users\gg\Desktop\book.txt','a',encoding='utf-8') as file1:
file1.write('小兰:8本\n')
file1.write('小强:12本\n')
file1.write('李明:15本\n')
\ No newline at end of file
file1.write('小兰:12本\n')
file1.write('小强:10本\n')
file1.write('李明:15本\n')
with open(r'C:\Users\gg\Desktop\book.txt','r',encoding='utf-8') as file2:
a=file2.read()
for i in a:
if '小强:10本' in a:
print("aaaaa")
if '小兰:12本' in a:
print("aaaaa")
\ 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