# Yeti Eater Help!

**URL:** <https://discourse.codecombat.com/t/yeti-eater-help/22607>\
**Category:** Level Help\
**Created:** [June 28, 2020, 8:46pm UTC](https://discourse.codecombat.com/t/yeti-eater-help/22607 "2020-06-28T20:46:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KalPal](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/kalpal/32/12792_2.png) [@KalPal](https://discourse.codecombat.com/u/KalPal)\
**Post date:** [June 28, 2020, 8:46pm UTC](https://discourse.codecombat.com/t/yeti-eater-help/22607/1 "2020-06-28T20:46:35Z")

</div>

I’ve tried the Yeti Eater Level with no avail of how to solve it. What should I do?

Thank you!

```python
# Yetis surround us and we need to defeat them.
# Luckily the wizard had time to cast the sleep spell.
# Your hero can devour the yetis' vital powers when they are defeated.
# Defeat them in the order from weakest to the strongest.

# The wizard sorted enemies, but in the order from the strongest to the weakest.
wizard = hero.findNearest(hero.findFriends())
yetis = wizard.findEnemies()

# You need iterate the yetis list in the reverse order with a 'for-loop'.
# The start value should be 'len(yetis) - 1'.
# Iterate while the index greater than -1.
# Use the negative step -1.
for i in range(len(yetis) - 1):
    while yetis.index > -1:
        yetis.index -= 1
    # Attack each enemy while its health greater than 0.
    for yeti in yetis:
        if yeti.health > 0:
            food = yeti
while True:
    if hero.isReady("devour"):
        if food.health > 0:
            hero.devour(food)
        else:
            yetis.index += 1

```

---

<div class="post-metadata">

**Author:** ![Anna](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/anna/32/8378_2.png) [@Anna](https://discourse.codecombat.com/u/Anna)\
**Post date:** [June 29, 2020, 1:00am UTC](https://discourse.codecombat.com/t/yeti-eater-help/22607/2 "2020-06-29T01:00:50Z")

</div>

Wait why are you actually using devour?

When you attack and kill the yeti you get more health. \*\* from the wizard I assume \*\*

---

<div class="post-metadata">

**Author:** ![AnSeDra](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ansedra/32/13123_2.png) [@AnSeDra](https://discourse.codecombat.com/u/AnSeDra)\
**Post date:** [June 29, 2020, 3:42am UTC](https://discourse.codecombat.com/t/yeti-eater-help/22607/3 "2020-06-29T03:42:03Z")

</div>

> [@KalPal](#):
>
> ```python
> while True:
> if hero.isReady("devour"):
> if food.health > 0:
> hero.devour(food)
> else:
> yetis.index += 1
> 
> ```

Here try to remove the while True and put the remaning ( this

> [@KalPal](#):
>
> ```python
> if hero.isReady("devour"):
> if food.health > 0:
> hero.devour(food)
> else:
> yetis.index += 1
> 
> ```

) after this line

> [@KalPal](#):
>
> `food = yeti`

And do not use devour, just simply attack while food’s health \> 0.

> [@KalPal](#):
>
> ```python
> for i in range(len(yetis) - 1):
> while yetis.index > -1:
> yetis.index -= 1
> # Attack each enemy while its health greater than 0.
> for yeti in yetis:
> if yeti.health > 0:
> food = yeti
> 
> ```

Here try to put an

```python
index = len(yetis) - 1
while index > -1:
    #here put the yetis[index] in the variabile food
    index -=1

```

And also here put

> [@KalPal](#):
>
> ```python
> if hero.isReady("devour"):
> if food.health > 0:
> hero.devour(food)
> else:
> yetis.index += 1
> 
> ```

Something like this:

```python
while food.health > 0:
    hero.attack(food)

```

Andrei
