Commit 3184b6cc by BellCodeEditor

save project

parent 42beb8d9
Showing with 7 additions and 6 deletions
...@@ -4,13 +4,13 @@ class hero: ...@@ -4,13 +4,13 @@ class hero:
self.l=1 self.l=1
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def shengji(self):
self.l=self.l+1
self.hp=self.hp+100
self.attack=self.attack+20
yase=hero(1,"yase",200,50) yase=hero(1,"yase",200,50)
houyi=hero(1,"houyi",100,100) houyi=hero(1,"houyi",100,100)
def shengji(): yase.shengji()
yase.l=yase.l+1 yase.shengji()
yase.hp=yase.hp+100
yase.attack=yase.attack+20
shengji()
shengji()
print(yase.hp) 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