if the name starts with apple you could use (for example):
for ob in bpy.context.scene.objects if ob.name.startswith(‘apple’): ob.select = True
or if apple is in the name but not the beginning:
for ob in bpy.context.scene.objects if ‘apple’ in ob.name: ob.select = True