Commit c08d4226 by BellCodeEditor

save project

parent e23c3d03
Showing with 6 additions and 24 deletions
class Hero:
def __main__(case):
case.level=1
case.hp=300
case.attack=20
yase=Hero()
print(yase.level)
\ No newline at end of file
class Hero(object)
def __init__(self,name):
info1=self.name+"对"+self.enemy+"发起进攻"
info2="造成"+str(self.attack)+"点伤害"
info=
\ No newline at end of file
class Hero:
def __init__(self,name,level,hp,acttack):
self.name=name
self.level=level
self.hp=hp
self.acttack=acttack
def UpLevel(self):
self.level=self.level+1
self.hp=self.level+50
self.acttack=self.acttack+4444
yase=Hero("亚瑟",1,20,40)
yase.UpLevel()
print(yase.acttack)
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