Commit 1ed4da07 by BellCodeEditor

save project

parent d407ec78
Showing with 13 additions and 6 deletions
class Hero: class Hero:
def __init__(self,name,hp,attack): def __init__(self,level,name,hp,attack):
self.level = 1 self.level = 1
self.name = name self.name = name
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
def shengji(name):
self.level = self.level + 1
self.hp = self.hp + 9999999999999999999999999999999999999
self.attack = self.attack + 11111111111111111111111111
yase = Hero("亚瑟",9999999999999999999,11111111)
gou =Hero("狗",100000000000,88888888888888)
print(yase.name+sty(yase.hp)) yase = Hero(1,"亚瑟",9999999999999999999,11111111)
print(gou) gouge =Hero(1,"狗哥",100000000000,88888888888888)
\ No newline at end of file yase.shengji()
gouge.shengji()
print(yase.name+str(yase.hp))
print(gou.name+str(yase.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