Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Help morale Help plz [SOLVED]


# You have one arrow. Make it count!

# This should return the enemy with the most health.
def findStrongestEnemy(enemies):
    strongest = 0
    strongestHealth = 0
    enemyIndex = 0
    # While enemyIndex is less than the length of enemies:
    while enemyIndex < len(enemies):
        # Set an enemy variable to enemies[enemyIndex]
        enemy = enemies[enemyIndex]
        # If is greater than strongestHealth
        if > strongestHealth:    
            # Set `strongest` to enemy
            # Set strongestHealth to
            strongestHealth =
            # Increment enemyIndex
        enemyIndex += 1
    return strongest

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

He is returning strongest but you are not assign it to something try to assign it to a enemy

in where? of the code?

In the start of your code you say
strongest = 0
And you return the strongest
enemyIndex += 1
return strongest
So you need to assign it just above the strongestHealth =

What am I suppost to assign?

You have to assign the strongest to the enemy

Thanks I got it.

Please put a [SOLVED] thing in the title, so everyone (like me) could see that this is solved.