Commit 3bde1a56 by BellCodeEditor

save project

parent e2f02c92
Showing with 11 additions and 10 deletions
......@@ -4,12 +4,13 @@ class Hero:
self.hp=hp
self.attack=attack
self.name=name
Yase=Hero(1,200,40,"Hero")
print(Yase.hp)
Hero:
def ad():
Yase.level=Yase.level+1
Yase.hp=Yase.hp+50
Yase.attack=Yase.attack
ad()
print(Yase.hp)
\ No newline at end of file
def a(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack
houyi=Hero(1,200,40,"Hero")
print( houyi.hp)
houyi.a()
print( houyi.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