Commit bb9c53bd by BellCodeEditor

auto save

parent 22354288
Showing with 15 additions and 0 deletions
class Hero():
level=1
def __init__(self,name,hp,attack):
self.level=2
self.name=name
self.hp=hp
self.attack=attack
yase_sb = Hero("垭瑟",300,20)
houyi_sb=Hero("后羿",240,23)
yase_sb.level=yase_sb.level+1
yase_sb.hp=yase_sb.hp+50
yase_sb.attack=yase_sb.attack+4
print("hp1:"+str(yase_sb.hp))
print("hp2:"+str(houyi_sb.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