Commit cec87a77 by BellCodeEditor

save project

parent 3591033e
Showing with 11 additions and 7 deletions
...@@ -4,11 +4,15 @@ class hero: ...@@ -4,11 +4,15 @@ class hero:
self.name = name self.name = name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def shenji(self):
self.hp=self.hp+50
self.level=self.level+1
self.attack=self.attack+4
yase=hero("yase",300,200) yase=hero("yase",300,200)
def upgraed(): yase.shenji()
yase.hp=yase.hp+50 print(yase.hp)
yase.level=yase.level+1 houyi = hero("后裔",200,400)
yase.attack=yase.attack+4 houyi.shenji()
upgraed()
print(yase.hp) print(houyi.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