Grim determination help 2

# Your goal is to protect Reynaldo

# Find the paladin with the lowest health.
def lowestHealthPaladin():
    lowestHealth = 99999
    lowestFriend = None
    friends = hero.findFriends()
    for friend in friends:
        if friend.type != "paladin":
        if < lowestHealth and < friend.maxHealth:
            lowestHealth =
            lowestFriend = friend
    return lowestFriend

def commandPaladin(paladin):
    # Heal the paladin with the lowest health using lowestHealthPaladin()
    # You can use paladin.canCast("heal") and command(paladin, "cast", "heal", target)
    # Paladins can also shield: command(paladin, "shield")
    # And don't forget, they can attack, too!
    if paladin.canCast("heal"):
        target = lowestHealthPaladin()
        if target:
            hero.command(paladin, "cast", "heal", target)
	   hero.command(paladin, "shield", hero)

def commandFriends():
    # Command your friends.
    friends = hero.findFriends()
    enemy = hero.findNearestEnemy()
    for friend in friends:
        if friend.type == "peasant":
            item = friend.findNearestItem() 
            hero.command(friend, "move", item.pos)
        elif friend.type == "griffin-rider":
            hero.command(friend, "attack", enemy)
        elif friend.type == "paladin":

while True:
    # Summon griffin riders!
    if >= hero.costOf("griffin-riders"):

I keep getting an error on line 49:
if >= hero.costOf(“griffin-riders”):
It keeps saying the argument should have type object but got string. I can’t see what’s wrong with my code though?

Hi, look at these two statements:
Can you see the difference?
To work out which one’s right, think how many griffin riders you’re summoning or checking the price of.
:lion: :lion: :lion:

Thanks! Feel so stupid missing that one!

This is very interesting ( and here it will obviously not run)

hero.command(paladin, "shield", hero) // the hero is far away

I tried hero.command(paladin, "shield", target ) in my code expecting an error but there was none!
Does this command make sense?
No, this command doesn’t make sense - it must be hero.command(paladin, "shield")
But in python there must be an error message!!! Try this code:

def fp(a, b):
    print('a: ' + a)
    print('b: ' + b)
print('### python missing 1 argument ###') 
print('### adding 1 argument plus ###')
fp(1, 2, 3)

The output in the browser console is:
and that is normal if the code was in java script but not for python.
Same code run in python console ( not in Code Combat ):
p1given p3given
I cannot say that’s a BUG, maybe this was the intention of the game designers, but count carefully the
number of arguments you’re feeding your function :slight_smile: