# \[SOLVED\] Brittle Morale Help Please

**URL:** <https://discourse.codecombat.com/t/solved-brittle-morale-help-please/15978>\
**Category:** Level Help\
**Created:** [September 19, 2018, 10:29pm UTC](https://discourse.codecombat.com/t/solved-brittle-morale-help-please/15978 "2018-09-19T22:29:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharknado](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sharknado/32/9124_2.png) [@Sharknado](https://discourse.codecombat.com/u/Sharknado)\
**Post date:** [September 19, 2018, 10:29pm UTC](https://discourse.codecombat.com/t/solved-brittle-morale-help-please/15978/1 "2018-09-19T22:29:54Z")

</div>

Can anyone help me I don’t understand what the code should be.

---

<div class="post-metadata">

**Author:** ![Sharknado](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sharknado/32/9124_2.png) [@Sharknado](https://discourse.codecombat.com/u/Sharknado)\
**Post date:** [September 19, 2018, 10:39pm UTC](https://discourse.codecombat.com/t/solved-brittle-morale-help-please/15978/2 "2018-09-19T22:39:27Z")

</div>

This is my code

```python
# You have one arrow. Make it count!

# This should return the enemy with the most health.
def findStrongestEnemy(enemies):
    strongest = enemy
    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)

```

my hero won’t do anything

---

<div class="post-metadata">

**Author:** ![MunkeyShynes](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/munkeyshynes/32/9277_2.png) [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)\
**Post date:** [September 19, 2018, 11:27pm UTC](https://discourse.codecombat.com/t/solved-brittle-morale-help-please/15978/3 "2018-09-19T23:27:56Z")

</div>

2 things.

1. In the first line of the function, strongest should start out being defined as `None`.
2. You have not followed all of the directions. See this line, _`# Set 'strongest' to enemy`_. You need to do that.

---

<div class="post-metadata">

**Author:** ![Sharknado](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sharknado/32/9124_2.png) [@Sharknado](https://discourse.codecombat.com/u/Sharknado)\
**Post date:** [September 20, 2018, 1:05pm UTC](https://discourse.codecombat.com/t/solved-brittle-morale-help-please/15978/4 "2018-09-20T13:05:16Z")

</div>

Thank you it work now. 🙂

---

<div class="post-metadata">

**Author:** ![Aqua](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/aqua/32/11282_2.png) [@Aqua](https://discourse.codecombat.com/u/Aqua)\
**Post date:** [January 17, 2020, 12:02am UTC](https://discourse.codecombat.com/t/solved-brittle-morale-help-please/15978/5 "2020-01-17T00:02:12Z")

</div>

thank you so much  
i had the same problem with my code

---

<div class="post-metadata">

**Author:** ![R\_Ross](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/r_ross/32/22031_2.png) [@R\_Ross](https://discourse.codecombat.com/u/R_Ross)\
**Post date:** [May 18, 2021, 7:26pm UTC](https://discourse.codecombat.com/t/solved-brittle-morale-help-please/15978/6 "2021-05-18T19:26:53Z")

</div>

Me too, thanks  
The fact that the singular arrow did 8,947 damage though… I dont wanna be on the wrong side of that guy…

---

<div class="post-metadata">

**Author:** ![Roboham](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/roboham/32/22883_2.png) [@Roboham](https://discourse.codecombat.com/u/Roboham)\
**Post date:** [June 10, 2021, 10:17am UTC](https://discourse.codecombat.com/t/solved-brittle-morale-help-please/15978/7 "2021-06-10T10:17:23Z")

</div>

Huh? I just used your code and won!!? 🙄🙄😆

---

<div class="post-metadata">

**Author:** ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)\
**Post date:** [June 10, 2021, 11:50am UTC](https://discourse.codecombat.com/t/solved-brittle-morale-help-please/15978/8 "2021-06-10T11:50:08Z")

</div>

Hi this person is not active anymore so your just wasting your post. And also try not to copy other peoples codes.
