Commit 40778718 by BellCodeEditor

save project

parent dc22b1a3
# 写入同学们的捐赠明细:'小兰:12本'、'小丽:11本'、'李文:9本'、'张伟:16本'
# m=open(r'D:\www\xxx.txt','w',encoding='utf-8')
# m.write('小兰:12本\n')
# m.write('小丽:11本\n')
# m.write('李文:9本\n')
# m.write('张伟:16本\n')
# m.close()
# m=open(r'D:\www\xxx.txt','a',encoding='utf-8')
# m.write('jjjjjjjjjjjjjjjjj:12000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000本\n')
# m.close()
with open(r'D:\www\xxx.txt','a',encoding='utf-8') as m:
m.write('鸡哥:99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999本\n')
m.write('蔡徐坤:88888888888888888888888888888888888888888888888888888888888888888888888888888888888本')
\ No newline at end of file
with open(r'D:\www\xxx.txt','r',encoding='utf-8') as m:
for data in m:
if '小兰:12本' in data:
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