Hey there, what language are you using?
I’m not sure, but it seems to me that it should be else if on line 5, or possibly elif.
Also, to format the code, you can highlight it and then push the </> button.
Hope I helped!
As people have said before, format your code properly. I’ve done it for you this time, but do so yourself in the future.
I’ll go through your code step by step:
Line 3: You need to check for enemy, since you already created a variable for findNearestEnemy(). Also, if-statements require a colon after the statement is asked.
Line 5: You only need an else, not an if else. Again with the colon.
Overall comment: Your indentations are a little mixed up. You need to indent your code inside the loop all the same level, then indent one more for if and else blocks.