I need help with my code and there are no errors.
# This level shows how to define your own functions. # The code inside a function is not executed immediately. It's saved for later. # This function has your hero collect the nearest coin. def pickUpNearestCoin(): items = self.findItems() nearestCoin = self.findNearest(items) if nearestCoin: self.move(nearestCoin.pos) # This function has your hero summon a soldier. def summonSoldier(): # Fill in code here to summon a soldier if you have enough gold. while self.gold > self.costOf("soldier"): self.summon("soldier") for soilder in soilders: if enemy: self.command(soilder, "attack", enemy) pass # This function commands your soldiers to attack their nearest enemy. def commandSoldiers(): for soldier in self.findFriends(): enemy = soldier.findNearestEnemy() if enemy: self.command(soldier, "attack", enemy) loop: # In your loop, you can "call" the functions defined above. # The following line causes the code inside the "pickUpNearestCoin" function to be executed. pickUpNearestCoin() # Call summonSoldier here summonSoldier # Call commandSoldiers her