Commit 2ef0ab34 by BellCodeEditor

save project

parent 07bfb089
Showing with 12 additions and 7 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name='yase'
self.hp=10000
self.attack=10000
def qwe(self):
self.level=self.level+1
self.hp=self.hp+5000
self.attack=self.attack+1000
self.name= name
self.hp= hp
self.attack = attack
def qwe(self):
self.level=self.level+1
self.hp=self.hp+5000
self.attack=self.attack+1000
yase = Hero('亚瑟',1000,300)
print(yase.hp)
yase.qwe()
print(yase.hp)
\ 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