Commit 47c59851 by BellCodeEditor

save project

parent d6c81a0f
Showing with 16 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level = 1
self.name = name
self.hp = hp
self.attack = attack
TSLJ = Hero('太上老君',500,20)
NW = Hero('女娲',350,45)
def NWupgrade():
NW.level = NW.level + 1
NW.hp = NW.hp + 60
NW.attack = NW.attack + 35
#测试
# print(NW.level,NW.hp,NW.attack)
# NWupgrade()
# print(NW.level,NW.hp,NW.attack)
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