Use Python generator to solve the ‘find-all’ problems