Commit 1b6c8fe5 by BellCodeEditor

save project

parent ef39df1c
Showing with 43 additions and 5 deletions
class hero: class Hero:
def __init__(self): def __init__(self,name,HP,attack):
self.level=1 self.level1=1
self.hp=300 self.name=name
self.attack=2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 self.HP=HP
self.attack=attack
def upgrade(self):
self.level1=self.level1+1
self.HP=self.HP+50
self.attack=self.attack+26
yase=Hero("亚瑟",300,90)
yase.HP=350
yase.upgrade()
print('亚瑟的HP为'+str(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