Commit 021d6faa by BellCodeEditor

save project

parent 22354288
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
yase=Hero('yase',300,20)
hy=Hero('hy',250,23)
k=Hero('K',5600,199)
print(yase.attack)
print(hy.attack)
print(k.attack)
arte=Hero('arte',7800,6880)
print(arte.name,arte.hp,arte.attack)
###lass hero:
"""
def__init__(self,name,hp):
self.name=name
self.hp=hp
yase=hero("坤坤",4424424)
def upgrade():
yase.name=yase.name+50
yase.hp=yase.hp+50
upgrad()
upgrad()
c
"""
lass hero:
def__init__(self,name,hp):
self.name=name
self.hp=hp
self=hero("坤坤",4424424)
def upgrade():
self.name=self.name+50
self.hp=self.hp+50
upgrad()
upgrad()
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