I’m working on Mad Maxer Redemption and have redone my code from Strikes Back. However, it keeps telling me that Cairin (an archer) should go home even though some villagers have less heath than her. Here’s my code:
``
loop:
weakest = None
leastHealth = 99999
friendIndex = 0
friends = self.findFriends()
while friendIndex < len(friends):
friend = friends[friendIndex]
if friend.health < leastHealth:
weakestFriend = friend
leastHealth = friend.health
self.say('Hey ' + weakestFriend.id + ', go home!')
friendIndex = friendIndex + 1
``