Commit 3d83739f by BellCodeEditor

auto save

parent 92ee13a6
Showing with 11 additions and 4 deletions
......@@ -4,7 +4,14 @@ class Hore:
self.name = name
self.hp = hp
self.attack = attack
def upgrade(self):
self.level = self.level + 1
self.hp = self.hp + 35
self.attack = self.attack + 10
yase = Hore("垭瑟",300,20)
houyi = Hore("后羿",250,23)
print(yase.attack)
print(houyi.attack)
\ No newline at end of file
yase.upgrade()
print("等级:",yase.level)
print("能量:",yase.hp)
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