Okay. A for-loop is a loop that allows you to loop through a list, like all objects in a scene, and perform an operation on each one of them. You can easily test to see if a property is in each object, and if so, append that object to a list, like so:
sce = logic.getCurrentScene()
objectlist = 
for o in sce.objects:
if 'empty' in o: # If you find an object with an 'empty' property,
objectlist.append(o) # Add the object reference to the list
print (objectlist) # Print out the list of objects that have an 'empty' property
You can easily add in a check to see what the ‘empty’ property is after the initial if check (i.e. if ‘empty’ in o and o[‘empty’] == 1).
EDIT: Note that this loops through every object in the scene, which is every game object in the current game scene. This will get slower with every object that you add. If you find that this list check is slow, then you’ll have to use a list you maintain yourself (i.e. a list of bags that you check).