Matimus a écrit :
On Sep 8, 12:32 am, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
(snip)
>>> set(a).issubset(set(b))
True
>>>
Just to clarify, doing it using sets is not going to preserve order OR
number of elements that are the same.
That is:
a = [1,1,2,3,4]
b = [4,5,3,7,2,6,1]
set(a).issubset(set(b))
True
This will return True if b contains at least on of each element found
in a. If the OP wanted to check that list `a` appeared in order
somewhere in list `b` then sets won't work.
Indeed, and I should have mentionned this myself. Thanks for this reminder.
--
http://mail.python.org/mailman/listinfo/python-list