list of objects ID python code example
Example: python list object ids
# assuming obj has an attribute id
list = [obj1, obj2, obj3]
ids = [obj.id for obj in list]
# assuming obj has an attribute id
list = [obj1, obj2, obj3]
ids = [obj.id for obj in list]