Commit b802b506 by BellCodeEditor

save project

parent 59875e9e
Showing with 19 additions and 5 deletions
class Hero():
def __init__(self):
def __init__(self,name,HP,attack):
self.level=1
self.HP=300
self.attack=1
yase = Hero()
print(yase.HP)
\ No newline at end of file
self.attack=20
def upgread(self):
self.level=houyi.level+1
self.HP=houyi.HP+50
self.attack=houyi.attack+5
yase = Hero('亚瑟',300,20)
houyi = Hero('后羿',240,24)
bianque = Hero('扁鹊',300,22)
yase.upgread()
houyi.upgread()
bianque.upgread()
print('亚瑟的血量是:'+str(yase.HP))
print('后羿的攻击力是:'+str(houyi.attack))
print('扁鹊的攻击力是:'+str(bianque.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