Commit 4654b5c9 by BellCodeEditor

auto save

parent acde3f15
Showing with 10 additions and 6 deletions
class Hero: class Hero:
def __init__(self,name,hp,attack): def __init__(self,name,hp,attack):
self.level=1 self.level=1
self.hp = 300 self.name = name
self.attack = 20 self.hp = hp
anbei=Hero() self.attack = attack
sange=Hero("",25,40) def upg():
anbei.hp = anbei.hp-15
anbei.attack = anbei.attack+1
anbei = Hero("anbei",30,10)
print("aaaaaaa",anbei.hp)
upg()
upg()
print(anbei.hp) print(anbei.hp)
print(sange.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