Commit 66713e71 by BellCodeEditor

save project

parent 5abf5229
Showing with 7 additions and 7 deletions
...@@ -4,14 +4,14 @@ class Hero: ...@@ -4,14 +4,14 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero("亚瑟",300,20)
print(yase.hp) def asd(self):
def asd():
self.level=self.level+1 self.level=self.level+1
self.hp=self.hp+50 self.hp=self.hp+50
self.attack=self.attack+4 self.attack=self.attack+4
yase=("亚瑟",300,20) yase=Hero("亚瑟",300,20)
yase.asd()
yase.asd() yase.asd()
print("等级是"+yase.level) print("等级是"+str(yase.level))
print("血量是"+yase.hp) print("血量是"+str(yase.hp))
print("攻击力是"+yase.attack) print("攻击力是"+str(yase.attack))
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