Commit 66713e71 by BellCodeEditor

save project

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