Commit c2114af6 by BellCodeEditor

save project

parent ca9bce02
Showing with 11 additions and 15 deletions
class hero:
def __init__(self,name,hp,attack,level):
self.attack=attack
self.hp=hp
self.level=level
self.name=name
Arthur=hero("Arthur",300,20,1)
Yi=hero("Yi",250,23,1)
print(Arthur.hp)
print(Arthur.attack)
print(Arthur.level)
print(Yi.hp)
print(Yi.attack)
print(Yi.level)
\ No newline at end of file
class hero:
def_init_(Arthur,name,hp,atk,level):
Arthur.name=name
Arthur.hp=hp
Arthur.atk=atk
Arthur.level=level
Arthur=hero("Arthur",2000,200,1)
def upgrade():
Arthur.hp=Arthur.hp+200
Arthur.atk=Arthur.atk+50
Arthur.level=Arthur.level+1
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