[Solved] Stuck in Brittle Morale


#1

Hi, my hero is not doing anything.
Can someone please tell me what is wrong with my code.

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


#2

Guys i found my mistake.
I hadnt put strongest = enemy.


#3

Great, could you put a [SOLVED] in the Title of the topic please so that everyone knows it’s already done.
Thanks. :grin:


#4

Done :wink: (20 characters)