Commit 4654b5c9 by BellCodeEditor

auto save

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