[Solved] Help with Summits Gate

I see what you mean, but that is the incorrect way to use the function. Currently you are just returning the last friend in the list not the friend with the lowest health, but since you need someone to meet your elif statement it works. I’m not sure why you have the code below checking for a friend with the lowest health and then healing the hero. If you are only looking to heal the hero, I’d remove the function and adjust the code just for the hero. One of my changes below.

            elif mostHurt and friend.canCast("heal"):
                self.command(friend, "cast", "heal", self)

After changing my gear to match yours and made three changes from your code. I was able to complete the level.

# with def findSkeletons(enemies): on line 3 
# line 96
            elif friend.canCast("heal") and hero.health < hero.maxHealth:
                self.command(friend, "cast", "heal", self)
# line 163 fix the or combination with () like you did with the chieftain
        elif warlock and hero.canCast("chain-lightning", warlock) or hero.isReady("bash"):  
# line 74
        elif self.pos.x < 275:
            self.move(points[3])  # change to [2]

So, this might be more related to your computer system than the code. I was able to complete everything when I was on my gaming computer with no problem, but my laptop gets the error
“Code never finished. It’s either really slow or has an infinite loop” when I run it.

Potentially Good News!! But, when I hit submit, it did complete everything and passes even with the error. Try that once.

That would make sense, I will try on my gaming computer soon.

Yay! It worked!!
Thanks SO much!

what does this mean?

The combination of “and” with “or” in the same line can mess it up if you don’t have it set up correctly. I see you made a nice adjustment for the chieftain that makes it work. Copy that for the warlock and you are good to go.

You shouldn’t really have asked on a 2-year old question, but I think they mean that if you had something like if False and True or True, it would be unclear what you were actually trying to say, since you might have meant if (False and True) or True, which would be True, or you could have meant if False and (True or True), which would be False.