Commit 97dfa2e0 by BellCodeEditor

auto save

parent 7033aec3
Showing with 7 additions and 9 deletions
......@@ -4,12 +4,10 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
def fkl(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
yase=Hero("亚瑟",300,20)
yase.upgrade()
print("等级为:",yase.level)
print("血量值为:",yase.hp)
print("攻击力为:",yase.attack)
\ No newline at end of file
self.hp=self.hp+10
self.attack=self.attack+100
yase=Hero("亚瑟",100000000000,6)
yase.fkl()
print(yase.hp)
\ 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