Can not finish echo-of-war

Good day!
Could you advise what’s wrong with my code? I couldn’t finish the level.
Thank you.

def isLetterInWord(word, letter):
    for index in range(len(word)):
        if word[index] == letter:
            return True
    return False


engineer = hero.findFriends()[0]
safeLetter = engineer.safeLetter

enemies = hero.findEnemies()
for index in range(len(enemies)):
    enemy = enemies[index]
    if isLetterInWord(enemy.id, safeLetter):
        while enemy.health>0:
            hero.attack(enemy)
1 Like

your code is correct and runs fine. Are you getting an error message? What is happening when you run it? This is probably an equipment issue.

The code is correct. You were right it’s equipment issue.
Thank you!