Commit 602b46c3 by BellCodeEditor

auto save

parent 1e71c359
Showing with 18 additions and 2 deletions
...@@ -3,5 +3,21 @@ class Hero: ...@@ -3,5 +3,21 @@ class Hero:
self.hp=hp self.hp=hp
self.Gj=Gj self.Gj=Gj
self.dj=1 self.dj=1
#houyi=Hero(50,30)
#print(houyi.Gj)
def shj(self):
self.dj=self.dj+1
self.Gj=self.Gj+5
self.hp=self.hp+10
yase=Hero(100,20) yase=Hero(100,20)
print(yase.Gj) yase.shj()
\ No newline at end of file print('亚瑟生命值为:',yase.hp)
print('亚瑟攻击值为:',yase.Gj)
print('亚瑟等级为:',yase.dj)
houyi=Hero(50,40)
houyi.shj()
print('后羿生命值为:',houyi.hp)
print('后羿攻击值为:',houyi.Gj)
print('后羿等级是:',houyi.dj)
\ 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