Get parent from a collection that's already in a collection

Im really struggling with what seems to be an easy task, however Im not able to make this work.

I need to get the parent inside of a collection that's already in a collection,

with the code im using

    print(collection)
if collection.name == doorname:
door = collection.children[0]
print(door) //OUTPUT: <bpy_struct, Collection("Door") at 0x7ff8f180b678>
for objects in door:
print(objects) //Error


I want all the objects in the Door collection to be printed. Is there a way to do this, what am I missing?

• Suggest this is for o in door.objects or for o in door.all_objects to get all objects in door collection and its children. Feb 24 '21 at 10:48
Maybe for objects in door.children since you're parenting them?