Commit 69839c1b by BellCodeEditor

save project

parent f5dd9051
Showing with 10 additions and 3 deletions
class Hero:
def __init__(self,name,hp,attack):
def __init__(self,leve1,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attac
\ No newline at end of file
self.attack=attack
def upgrade(self):
selt.leve1+=1
self.hp+=1
selt.attack+=1
ys= Hero('leve1,name,hp,attack')
ys.upgrade()
print(selt.hp,selt.attack)
\ 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