Commit c9e23b7e by BellCodeEditor

save project

parent 60ddc941
Showing with 7 additions and 4 deletions
......@@ -3,8 +3,12 @@ class Hero():
self.name= name
self.hp = hp
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)
daji = Hero("妲己",240,5)
print(yanse.hp)
\ No newline at end of file
yanse = Hero("亚瑟",300,24)
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