I have a list that looks like the following one:
my_list = [[[(2,3,4,5)]],[[8,2,4,2]],[[9,0,0,0]]]
Now, I want to find a way to make a new list zero_list
whose elements will be the 0th entries of each element in my_list
. That is
zero_list = [2, 8, 9]
How could I make a for
loop for iterating the 0th element of a list whose elements are lists themselves? Of course in my real example I have a much bigger such list with thousands of entries who are lists themselves.
P.S. I understand this is probably an easy question but I could not figure it out.
my_list
has three lists which have 3, 2, 2 depths respectively. Can you change your sample to reflect your situation?