Commit 4b72529b by BellCodeEditor

auto save

parent 1b733612
Showing with 6 additions and 14 deletions
class Hero: class Hero:
def __init__(self,name,hp,attack): def __init__(self,name,hp,attack):
self.Level=1 self.Name=name
self.Name=name self.Hp=hp
self.Hp=hp self.Attack=attack
self.Attack=attack
HIM=Hero('亚瑟',100,50) HIM=Hero('亚瑟',100,50)
ROBBOT=Hero('K-3573',200,100) DA=Hero('韩团',10,100)
print(HIM.Hp) print(HIM.Hp)
print(ROBBOT.Hp) print(DA.Hp)
def HIMup(b): \ No newline at end of file
HIM.Level+=1*b
HIM.Hp+=50*b
HIM.Attack+=4*b
def BOBBOTup(a):
BOBBOT.Level+=1*a
BOBBOT.Hp+=50*a
BOBBOT.Attack+=4*a
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