Commit b3365cb3 by BellCodeEditor

save project

parent 22354288
Showing with 16 additions and 0 deletions
class YingXiong:
def __init__(self,hp,pp):
self.hp=hp
self.pp=pp
# houyi=YingXiong(200,8)
def upgrade(self):
self.hp=self.hp+10
self.pp=self.pp+1
yase=YingXiong(100,10)
yase.upgrade()
yase.upgrade()
yase.upgrade()
print('亚瑟的血量为',yase.hp)
print('亚瑟的剩余出招次数为',yase.pp)
# print('后羿的血量为',houyi.hp)
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