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
- d -> list_a
but is there a way I can pull both together to form their own list?
Answer:Use list comprehension:
If you have better answer, please add a comment about this, thank you!