Commit 22e0e3d5 by BellCodeEditor

save project

parent 91f558ff
Showing with 10 additions and 10 deletions
with open (r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8')as file: class Hero:
a=file.readlines() def __init__(self):
for i in a: self.leve1 = 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.hp)
print(result) print(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