Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

[SOLVED]Friend or foe help[SOLVED]


I know there are same topics with my problem I looked at them but I couldn’t figure out the answer please help!

while True:
    friend = hero.findNearestFriend()
    if friend:
        hero.say("To battle, " + + "!")
    # Now find the nearest enemy and tell them to go away.
        enemy = hero.findNearestEnemy()
        hero.say("Go away, " + + "!")

My problem is that my hero doesn’t tell the orges to go away. I also tried to code so that my hero toll the villagers/ peasant to attack, but that didn’t work either. It probably is some silly mistake that I made but I can figure it out.
Thanks if you could hint me something!




and use elif enemy:.