Commit 5abf5229 by BellCodeEditor

save project

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