Commit 5a2ae833 by BellCodeEditor

save project

parent bcb178e5
Showing with 10 additions and 3 deletions
class Hero:
def __init__(self,hp,attack):
def __init__(self,level,hp,attack):
self.hp=hp
self.level=level
self.attack=attack
ling=Hero(300,45)
lin=Hero(1,100000)
ling=Hero(1,300,45)
lin=Hero(1,1,100000)
print(ling.hp)
def a(self):
self.level=self.level+1
self.hp=self.hp+100
self.attack=self.attack+15
ling=Hero('')
print(ling.hp,ling.attack,ling.level)
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