The Two Flowers coin problem

Working on two flowers. need help with pickUpNearestCoin():
this is my code for it.

def pickUpNearestCoin():
    enemy = self.findNearestEnemy()
    if not enemy:
        self.pickUpNearestCoin()

can someone help me

You created a function that calls itself when there are no enemies…

Maybe it should look for coins and then move to them.

To explain what Vlevo said he means that the code has to be code to actually pickup the coins the

    enemy = self.findNearestEnemy();
    if not enemy:
         self.pickUpNearestCoin();

should go in you loop

in the defining area you should write code to pickUp the coins