Commit 05042ab4 by BellCodeEditor

save project

parent 73a45ec1
Showing with 11 additions and 8 deletions
...@@ -3,12 +3,15 @@ class Hero: ...@@ -3,12 +3,15 @@ class Hero:
self.level=9 self.level=9
self.hp=400 self.hp=400
self.ap=40 self.ap=40
def one(self):
self.level=self.level+3
self.hp=self.hp+40
self.ap=self.ap+9
yase=Hero() yase=Hero()
yase.one()
print(yase.hp) print(yase.hp)
class Hero2: houyi=Hero()
def __init__(self2): houyi.one()
self2.level=8 print(houyi.hp)
self2.hp=350 \ No newline at end of file
self2.ap=35
hoyi=Hero2()
print(hoyi.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