Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Ogre Encampment Help Please!


Hi, I need help solving this puzzle. I am using python and would appreciate any help given for python coding.


By the way, here is the code that I am using:

Enemy == self.findNearestEnemy()
if enemy:
if not enemy:

For the coding that is bold in italics, it keeps telling me that “Enemy” is not defined.
Can somebody please help?


use 1 =
= for assigning variables
== for comparing two statements


Sorry, meant to put this in and ask, how does this help define “Enemy”? :confused:


Enemy is a variable:
You save somthing as a variable by using =

enemy = self.findNearestEnemy() saves the result of self.findNearestEnemy() as enemy

If you try to use the variable before you have saved something as the variable the computer will say the variable is undefined. It would like be trying to open a computer file before you saved it.