Commit d4107b2a by BellCodeEditor

save project

parent d6c81a0f
Showing with 19 additions and 0 deletions
class Hero():
def __init__(self,name,hp,level,attack):
self.level = level
self.hp = hp
self.attack = attack
self.name = name
apiao = Hero("阿飘",1000,2,500)
阿膘 = Hero("阿膘",900,1.5,450)
def upgrade__apiao():
apiao.level+=1
apiao.hp+=200
apiao.attack+=100
upgrade__apiao()
upgrade__apiao()
print(apiao.name,apiao.hp,apiao.level,apiao.attack)
\ 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