Backwoods Standff A Help!

I have been stuck in this level for months. I’ve read all relevant post but none helped me get out. My code is:
while True:
enemy = hero.findNearestEnemy()
# Use an if-statement with isReady to check “cleave”:
if hero.isReady(“cleave”):
# Cleave!
hero.cleave(enemy)
# Else, if cleave is not ready:
else:
# Attack the nearest ogre.
hero.attack(enemy)
My equipment is

Can someone please help me? Thanks!

What happens when you run the code? Do you get an error? Does your hero just do nothing? Please provide a description of what happens.

You’re code looks okay but it’s hard to tell because you didn’t post it properly. Please learn to properly post your code from the game from now on using the </> button or it won’t format properly. When you click the </> button, the following will appear:
PostCode
There are many people here willing and able to help. If you use the </> button correctly, your code should look like this:

while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        hero.attack(enemy)
    else:
        hero.say("My code is formatted properly")

If it doesn’t look like the code above then you’re doing it wrong and we can’t see the structure of the code to troubleshoot whether or not that is the issue. Use the </> button and help us help you. This works when sending a private message as well. Thank you.

`

Hi,
My code looks like the screen shot. What happened is my hero cannot survive so I can’t pass this level.

I’ve attached the screen shot.

What happens when you run the code? Do you get an error? Does your hero do nothing? Please provide some information about what’s happening.

I just ran your code in this level with the exact same equipment and it worked. Is the problem that you are running out of health?

I figured it out. You either need to use a hero with more health or get better equipment. Everything is working properly but Hattori Hanzo simply doesn’t have the health to survive the level. With Tharin, it works fine.

Great! I changed hero and it finally works! Thank you so much!!