Commit c9e23b7e by BellCodeEditor

save project

parent 60ddc941
Showing with 5 additions and 1 deletions
...@@ -3,8 +3,12 @@ class Hero(): ...@@ -3,8 +3,12 @@ class Hero():
self.name= name self.name= name
self.hp = hp self.hp = hp
self.attck = attck self.attck = attck
def updata(self):
self.level =self.level+1
self.hp =self.hp+50
self.attck =self.attck+5
yanse = Hero("亚瑟",300,24) yanse = Hero("亚瑟",300,24)
daji = Hero("妲己",240,5)
print(yanse.hp) print(yanse.hp)
yanse.updata()
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