class Warrior:
    def __init__(self, name):
        self.name = name
        self.hp = 100

    def attack(self, target):
        target.hp -= 10
        print(target.hp)

mywarrior1 = Warrior("김")
mywarrior2 = Warrior("이")

mywarrior1.attack(mywarrior2)



Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: