Commit 3bde1a56 by BellCodeEditor

save project

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