Is this error or bug?


#1

For the level Brittle Morale:
Here is my code:

def findStrongestEnemy(enemies):
    strongest = None
    strongestHealth = 0
    enemyIndex = 0
   
    while enemyIndex<len(enemies):
        enemy=enemies[enemyIndex]
        if enemy.health>strongestHealth:
            strongest=enemy
        enemyIndex+=1
    return strongest

enemies = hero.findEnemies()
if enemies:
    hero.say(findStrongestEnemy(enemies))

I have no idea what is wrong with it, it worked once but never work again.


#2

You aren’t updating the strongestHealth variable.