Commit c5d2f189 by BellCodeEditor

auto save

parent e38b4619
Showing with 7 additions and 9 deletions
class Hero: class Hero:
def __init__(self,name,hp,attack): def __init__(self,name):
self.hp =hp self.hp =250
self.attack=attack self.attack=40
self.level=1 self.level=1
self.nane=name self.nane=name
yase=Hero("A",300,20) yase=Hero("A",300,20)
houy=Hero("B",240,27) houy=Hero("B",240,27)
yase.a()
def a(): yase.hp=yase.hp-50
houy.hp +=1
houy.attack+=1
houy.level+=3
a()
print(yase.hp) print(yase.hp)
print(houy.hp) print(houy.hp)
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