Question:
Python newbie here! I have a list like this:list_a = [[a,b,c], [d,e,f]]
And I’m trying to find a way to look at only the nth value in each list within the larger list.
i.e. So both a and d where want the first value in each
I understand I can do this:
- a -> list_a[0][0]
- d -> list_a[1][0]
but is there a way I can pull both together to form their own list?
Thanks.
Answer:
Use list comprehension:If you have better answer, please add a comment about this, thank you!