class Warrior:
def __init__(self, health=50, attack=5):
self.health = health
self.attack = attack
#
self.is_alive = True
if self.health <= 0:
self.is_alive = False
at = Warrior()
at.health = 0
print(at.health, at.is_alive)
>>> 0, True