# Brittle morale, help!

**URL:** <https://discourse.codecombat.com/t/brittle-morale-help/29123>\
**Category:** Level Help\
**Created:** [May 28, 2021, 2:58pm UTC](https://discourse.codecombat.com/t/brittle-morale-help/29123 "2021-05-28T14:58:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerald\_Jaydn\_Fernand](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/gerald_jaydn_fernand/32/22752_2.png) [@Gerald\_Jaydn\_Fernand](https://discourse.codecombat.com/u/Gerald_Jaydn_Fernand)\
**Post date:** [May 28, 2021, 2:58pm UTC](https://discourse.codecombat.com/t/brittle-morale-help/29123/1 "2021-05-28T14:58:34Z")

</div>

```python
https://codecombat.com/play/level/brittle-morale?
I need help, I did everything it asked of me and I still does not work.

# You have one arrow. Make it count!

# This should return the enemy with the most health.
def findStrongestEnemy(enemies):
    strongest = None
    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 enemy.health is greater than strongestHealth
        if enemy.health > strongestHealth:
            # Set `strongest` to enemy
            # Set strongestHealth to enemy.health
            strongestHealth = enemy.health
        # Increment enemyIndex
        enemyIndex += 1
    return strongest
enemies = hero.findEnemies()
leader = findStrongestEnemy(enemies)
if leader:
    hero.say(leader)
enemies = hero.findEnemies()
leader = findStrongestEnemy(enemies)
if leader:
    hero.say(leader)

```

---

<div class="post-metadata">

**Author:** ![cheddarcheese](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/cheddarcheese/32/22417_2.png) [@cheddarcheese](https://discourse.codecombat.com/u/cheddarcheese)\
**Post date:** [May 28, 2021, 3:00pm UTC](https://discourse.codecombat.com/t/brittle-morale-help/29123/2 "2021-05-28T15:00:54Z")

</div>

ah youve got it half right please format correctly by copying your code with ctrl c then click the \</\> button and paste it

---

<div class="post-metadata">

**Author:** ![Gerald\_Jaydn\_Fernand](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/gerald_jaydn_fernand/32/22752_2.png) [@Gerald\_Jaydn\_Fernand](https://discourse.codecombat.com/u/Gerald_Jaydn_Fernand)\
**Post date:** [May 28, 2021, 3:12pm UTC](https://discourse.codecombat.com/t/brittle-morale-help/29123/3 "2021-05-28T15:12:28Z")

</div>

did it, now what do I do?

---

<div class="post-metadata">

**Author:** ![Anonym](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/anonym/32/47546_2.png) [@Anonym](https://discourse.codecombat.com/u/Anonym)\
**Post date:** [May 29, 2021, 3:08pm UTC](https://discourse.codecombat.com/t/brittle-morale-help/29123/4 "2021-05-29T15:08:20Z")

</div>

Oh, I’m sorry, I can’t help you.Haven’t passed it myself.I’ll summon some guys to help you.  
@Eric_Tang , @098765432123 , @enPointe77.

---

<div class="post-metadata">

**Author:** ![WaWa\_Yang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/wawa_yang/32/17800_2.png) [@WaWa\_Yang](https://discourse.codecombat.com/u/WaWa_Yang)\
**Post date:** [May 29, 2021, 5:07pm UTC](https://discourse.codecombat.com/t/brittle-morale-help/29123/5 "2021-05-29T17:07:27Z")

</div>

First of all

> [@Gerald\_Jaydn\_Fernand](#):
>
> `len.enemies`

its supposed to be `(len(enemies)):`  
then you have

> [@Gerald\_Jaydn\_Fernand](#):
>
> ```python
> # Set `strongest` to enemy
> # Set strongestHealth to enemy.health
> 
> ```

read the first # ligne

---

<div class="post-metadata">

**Author:** ![enPointe77](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/enpointe77/32/43632_2.png) [@enPointe77](https://discourse.codecombat.com/u/enPointe77)\
**Post date:** [May 29, 2021, 5:08pm UTC](https://discourse.codecombat.com/t/brittle-morale-help/29123/6 "2021-05-29T17:08:07Z")

</div>

Why are you summoning me? If you haven’t passed it, I certainly haven’t.

---

<div class="post-metadata">

**Author:** ![WaWa\_Yang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/wawa_yang/32/17800_2.png) [@WaWa\_Yang](https://discourse.codecombat.com/u/WaWa_Yang)\
**Post date:** [May 29, 2021, 5:09pm UTC](https://discourse.codecombat.com/t/brittle-morale-help/29123/7 "2021-05-29T17:09:03Z")

</div>

> [@Gerald\_Jaydn\_Fernand](#):
>
> ```python
> enemies = hero.findEnemies()
> leader = findStrongestEnemy(enemies)
> if leader:
> hero.say(leader)
> enemies = hero.findEnemies()
> leader = findStrongestEnemy(enemies)
> if leader:
> hero.say(leader)
> 
> ```

I dont understand this last part. You put two

```python
enemies = hero.findEnemies()
leader = findStrongestEnemy(enemies)
if leader:
    hero.say(leader)

```

just keep one
