You have to define what type of flag that is. You have to say: flag = hero.findFlag("some kind of color"). The colors could be green, purple, or black.
It’s great that you finished the level but please don’t post finished code or final solutions. The purpose of this board is to help people figure out the solutions themselves so they can learn. Simply providing solutions/code is counterproductive to the main goal. Thank you.