I have a Node class with some attributes
I then have an array of Node objects
nodes = [
Node(some attributes),
Node(some attributes),
Node(some attributes),
]
I want to do something like this
for i, node in enumerate(nodes):
arr[i] = node.attribute
print(arr)
by typing something like
print(nodes.attribute)
or
print([nodes].attribute)
or
print(nodes[*].attribute)
etc.
and then have it return something like
print(nodes)
but with the specific attribute instead of returning the objects
I'm somewhat new to python, and it seems like this should be easier than iterating through the array.
is there?