Commit eba40d2e by BellCodeEditor

save project

parent 75590d66
Showing with 8 additions and 8 deletions
...@@ -4,16 +4,17 @@ class Hero: ...@@ -4,16 +4,17 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def a(self)): def a(self):
yase.level=yase.level+1 self.level=self.level+1
yase.hp=yase.hp+100 self.hp=self.hp+100
yase.attack=yase.attack+4 self.attack=self.attack+4
yase = Hero("垭瑟",300,20) yase = Hero("垭瑟",300,20)
houyi = Hero("后羿",200,40) houyi = Hero("后羿",200,40)
a() a()
print('亚瑟的等级为:' + yase.level) print(yase.level)
print('亚瑟的血量为:' + yase.hp) print(yase.hp)
print('亚瑟的攻击为:' + yase.attack) print(yase.attack)
\ No newline at end of file
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