Commit 58d00f26 by BellCodeEditor

save project

parent 36a5a742
Showing with 7 additions and 9 deletions
...@@ -4,13 +4,10 @@ class hero: ...@@ -4,13 +4,10 @@ class hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def sj(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+20
yase=hero("yase",300,20) yase=hero("yase",300,20)
houyi=hero("houyi",240,35) yase.sj()
def sj(): print(yase.attack,yase.hp,yase.level)
yase.level=yase.level+1 \ No newline at end of file
yase.hp=yase.hp+50
yase.attack=yase.attack+20
sj()
sj()
sj()
print(yase.level,yase.hp,yase.attack)
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