Commit ecf0cd47 by BellCodeEditor

save project

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