Commit abf7d6c8 by BellCodeEditor

save project

parent e17b9dcc
Showing with 10 additions and 10 deletions
with open(r'C:\Users\Administrator\Documents\lesson13_2\sales_list.txt','r',encoding='utf-8') as file: class hero:
a=file.readlines() def __init_(self):
for i in a: self.level=1
data=i.split() self.hp=300
sum=0 self.attack=20
for sales in data[1:]:
sum=sum+int(sales) yase=hero()
result=data[0]+':'+str(sum) print("yase血量:",yase.hp)
print(result) print("yas伤害:",yase.attack)
\ No newline at end of file \ 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