On Monday, January 9, 2017 at 12:50:11 PM UTC-8, Joaquin Alzola wrote:
> >> elements. For example, if we have a list_a=["a","b","c","d"] and
> >> list_b=["a","b"] I want to obtain a new list_c containing elements that
> >> match between these lists (a and b here),
>
> >Perhaps this might work:
>
>> elements. For example, if we have a list_a=["a","b","c","d"] and
>> list_b=["a","b"] I want to obtain a new list_c containing elements that
>> match between these lists (a and b here),
>Perhaps this might work:
list(set(list_a).intersection(set(list_b)))
>['a', 'b']
>>> list_a={"a","b","
On Mon, Jan 9, 2017 at 1:02 PM, Gilmeh Serda
wrote:
> On Mon, 09 Jan 2017 05:08:51 -0800, José Manuel Suárez Sierra wrote:
>
>> elements. For example, if we have a list_a=["a","b","c","d"] and
>> list_b=["a","b"] I want to obtain a new list_c containing elements that
>> match between these lists (
José Manuel Suárez Sierra wrote:
> This is the traceback:
> line 18, in
> for transf2[j] in transf2:
> IndexError: list assignment index out of range
>
> If I have initialized j=0 (such as i) why does it not work?
A for loop
for x in y:
...
sequentually assigns every value in y to x. So wi
El lunes, 9 de enero de 2017, 14:09:09 (UTC+1), José Manuel Suárez Sierra
escribió:
> Hello, I am trying to make a code wich compares between 2 or several
> sequences (lists). It compares every element in a list with another list
> elements. For example, if we have a list_a=["a","b","c","d"] an
El lunes, 9 de enero de 2017, 14:09:09 (UTC+1), José Manuel Suárez Sierra
escribió:
> Hello, I am trying to make a code wich compares between 2 or several
> sequences (lists). It compares every element in a list with another list
> elements. For example, if we have a list_a=["a","b","c","d"] an
José Manuel Suárez Sierra wrote:
> Hello,
Welcome!
> I am trying to make a code wich compares between 2 or several
> sequences (lists). It compares every element in a list with another list
> elements. For example, if we have a list_a=["a","b","c","d"] and
> list_b=["a","b"] I want to obtain a
José Manuel Suárez Sierra wrote, on January 09, 2017 5:09 AM
>
> Hello, I am trying to make a code wich compares between 2 or
> several sequences (lists). It compares every element in a
> list with another list elements. For example, if we have a
> list_a=["a","b","c","d"] and list_b=["a","b"]