Commit 0173aa4e by BellCodeEditor

save project

parent 7cf400c5
Showing with 11 additions and 4 deletions
class Hero: class Hero:
def __init__(self,name,levell,hp,attack): def __init__(self,name,level,hp,attack):
self.levell=levell self.level=level
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def crjy():
yase.level=yase.level+1
yase.hp=yase.hp+1
yase.attack=yase.attack+1
yase=Hero("亚瑟",3,300,4) yase=Hero("亚瑟",3,300,4)
lan=Hero("澜",3,200,8) crjy()
print(yase.hp) print(yase.hp)
print(lan.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