Can not finish echo-of-war


#1

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)

#2

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.


#3

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