Commit ecf0cd47 by BellCodeEditor

save project

parent 0b9925bd
Showing with 10 additions and 6 deletions
......@@ -4,8 +4,12 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
yase=Hero('亚瑟',200,400)
hy=Hero('后羿',300,500)
print(yase.attack)
print(hy.attack)
print(k.attack)
\ No newline at end of file
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+50
self.name=self.name+4
houyi=Hero("HOYI,240,23")
houyi.upgrade()
print("等级",houyi.level)
print("血量",houyi.hp)
print("攻击力",houyi.name)
\ 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