Commit 4c63e12f by BellCodeEditor

save project

parent 9bc43e81
Showing with 19 additions and 0 deletions
class Hero:
def __init__(self,name,hp,gongji):
self.dengji = 1
self.name = name
self.hp = hp
self.gongji = gongji
def shenji(self):
self.dengji=self.dengji+1
self.hp=self.hp+50
self.gongji=self.gongji+4
yase = Hero("亚瑟",300,20)
for i in range(3):
yase.shenji()
print("亚瑟血量:",yase.hp)
#print("催逝员血量:",cuishiyuan.hp)
#hoyi = Hero("后羿",230,23)
#cuishiyuan = Hero("催逝员",300,50)
#print("后羿血量:",hoyi.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