I have the lists:
a_list =[['a','1'],['b','2'],['c','3']...]
b_list=['a','b','c']
To access an element that is letters in a_list
we would do a_list[0][0]
However if I try to do this a_list[0:3][0]
I kept getting the same result as a_list[0][0]
. How might I get all three elements of the a_list
.
This is problem because then I can't use the following code:
all(x in [['a','1'],['b','2'],['c','3']] for x in ['a','b','c'])
The list I have is a lot larger so it would be nice if I can represent as a slice like this:
all(x in a_list[0:3][0] for x in ['a','b','c'])
But the list instead represents the index of the slice not the index of the list contained in the list.