Sarven shepherd help!

it shows no wrong lines or start unidentified. thank you
here is my code.

while True:
enemies = hero.findEnemies()
enemyIndex = 0

while enemyIndex > len(enemies):
enemy = enemies[enemyIndex]
if enemy.type != “sand-yak”:
while enemy.health > 0:
self.attack(enemy)
pass

hero.moveXY(40, 32)

In the code, you should check if enemy is valid or true. Could you send a screenshot of the error?