Really newbie to the code, so I would appreciate your answer, because I didn't find it.
I want to use value (which is hero_health_bar) in couple of assignments, but it just doesn't let me do this, maybe you can give me advice
hero_health_bar = 100
def enemy_attack():
monster_damage_from_hit = round(random() * 40)
chance = randint(1, 10)
if chance >= monster_loose_chance and chance <= monster_crit_chance:
if (hero_health_bar - monster_damage_from_hit) >= 0:
hero_health_bar -= monster_damage_from_hit
print(f'Monster hits you, dealing {monster_damage_from_hit} damage)