I have a list of objects. Object has 3 string attributes. I want to make a list containing only a specific attribute from class.
Is there any built-in functions to do that?
python
I have a list of objects. Object has 3 string attributes. I want to make a list containing only a specific attribute from class.
Is there any built-in functions to do that?
Best Solution
A list comprehension would work just fine:
But there is a combination of built-in functions, since you ask :-)