Commit e029d6ec by BellCodeEditor

save project

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