Commit d32c4f33 by BellCodeEditor

auto save

parent 04b71fa0
Showing with 63 additions and 0 deletions
with open(r'D:\dZm XZFCSADXZYDKUCDSTHGAFGZBXNDV\sales_list.txt','r',encoding='utf-8') as file:
a=file.readlines()
for i in a:
data=i.split()
sum=0
for i in data[1:]:
sum=sum+int(i)
r=data[0]+str(sum)
print(r)
dict_hero={'housan':10,'houyi':21,'houwu':22,'houduiz':29,'houqi':30,}
print(dict_hero)
\ No newline at end of file
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
self.level= self.level=1
self.hp=yase.hp+100
self.attack=self.attack+20
yase = Hero("dftg",1000,10)
yase.upgrade()
print("yase的血量是:",yase.hp)
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