Commit 300919fa by BellCodeEditor

save project

parent 5037a38d
Showing with 15 additions and 1 deletions
with open(r'C:\Users\ASUS\Desktop\test\open.txt','a',encoding='utf-8') as file:
mew_data=''
with open(r'C:\Users\ASUS\Desktop\test\open.txt','a',encoding='utf-8') as file1:
file1.write('小兰:捐了12本\n')
file1.write('小丽:捐了11本\n')
file1.write('小李文:捐了9本\n')
file1.write('张伟:捐了16本\n')
file1.write('莉莉:捐了2本\n')
with open(r'C:\Users\ASUS\Desktop\test\open.txt','r',encoding='utf-8') as file1:
for data in file1:
if'小兰:捐了12本'in data:
print('真')
if'小丽:捐了11本'in data:
print('真')
with open(r'C:\Users\ASUS\Desktop\test\open.txt','r',encoding='utf-8') as file1:
file1.write(new_data)
with open(r'C:\Users\ASUS\Desktop\test\open.txt','r',encoding='utf-8') as file1:
a=file1.read()
print(a)
\ 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