Commit be25cd36 by BellCodeEditor

save project

parent 1c287cd9
Showing with 8 additions and 4 deletions
# 写入同学们的捐赠明细:'小兰:12本'、'小丽:11本'、'李文:9本'、'张伟:16本'
feil=open()(r'C:\Users\Administrator\Desktop.txt','a',encoding='utf-8')
feil.write('小灰灰:1000000000000000000000000\n')
feil.write('喜羊羊:99999999999999999999999999999\n')
feil.close
\ No newline at end of file
feil.write('小灰灰:100\n')
feil.write('喜羊羊:9999\n')
feil.close
for data in file:
if'小灰灰:100'in data:
print('小灰灰数据在文件中')
if'喜羊羊:9999'in data:
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