Jun-28-2017, 12:23 PM
How do I create the list c=[2,3,4] from the list a=[[1,2,3],[2,3,4],[3,4,5]]? In other words, how do I create a list from element [1] of a list containing nested sequences?
I know b,c,d=zip(*a) produces b=[1,2,3], c=[2,3,4], and d=[3,4,5]. That works well, but I don't need b and d. It seems I should be able to use zip(*a[1]) or something of the sort but I have no success.
This is a minor problem but I must be missing something obvious.
I know b,c,d=zip(*a) produces b=[1,2,3], c=[2,3,4], and d=[3,4,5]. That works well, but I don't need b and d. It seems I should be able to use zip(*a[1]) or something of the sort but I have no success.
This is a minor problem but I must be missing something obvious.
my code here