Commit c7e22cd9 by BellCodeEditor

save project

parent d6c81a0f
Showing with 18 additions and 0 deletions
class Hero:
def __init__(self,name,HP,MP,attack):
self.level=1
self.name=name
self.HP = HP
self.MP = MP
self.attack = attack
def level():
self.level=2
self.HP = HP+50
self.MP = MP+30
self.attack = attack+10
level()
yase = Hero(110,300,200,120)
houyi = Hero(120,250,300,200)
print(yase.HP)
print(houyi.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