Commit ca3c4459 by BellCodeEditor

auto save

parent 4978a003
Showing with 2 additions and 18 deletions
class Hero:
def __init__(self,name,hp,gong):
self.level=1
self.name=name
self.hp=hp
self.gong=gong
def shengji(self):
self.level=self.level+1
self.hp=self.hp+50
self.gong=self.gong+4
houyi=Hero('后羿',240,25)
yase=Hero('亚瑟',300,20)
houyi.shengji()
yase.shengji()
print(yase.hp)
print(houyi.gong)
\ No newline at end of file
pen1=tu
\ 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