Commit eba1c7d7 by BellCodeEditor

save project

parent 10e79a0f
Showing with 8 additions and 9 deletions
...@@ -4,11 +4,10 @@ class Hero: ...@@ -4,11 +4,10 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero('yase',300,20) def q(self):
def q(): self.level=self.level+1
yase.level=yase.level+1 self.hp=self.hp+50
yase.hp=yase.hp+50 self.attack=self.attack+4
yase.attack=yase.attack+4 houyi=Hero('houyi',300,20)
q() houyi.q()
q() print(houyi.hp)
print(yase.hp) \ No newline at end of file
\ 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