Commit b8966e14 by BellCodeEditor

save project

parent f85c13a5
Showing with 5 additions and 5 deletions
...@@ -4,12 +4,12 @@ class Heor: ...@@ -4,12 +4,12 @@ class Heor:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def deji(): def deji(self):
self.level=self.level+1 self.level=self.level+1
self.hp=self.hp*1.25 self.hp=self.hp*1.25
self.attack=self.attack*1.05 self.attack=self.attack*1.05
yase=Heor('亚瑟',300,20) yase=Heor('亚瑟',300,20)
yase.deji() yase.deji()
print('等级为'+str(yase.level)) print('等级为',yase.level)
print('血量为'+str(yase.hp)) print('血量为',yase.hp)
print('攻击力为'+str(yase.attack)) print('攻击力为',yase.attack)
\ No newline at end of file \ 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