compare list

Ben Bush pythonnew at gmail.com
Mon Nov 14 12:51:36 CET 2005


I have four lists:
lisA=[1,2,3,4,5,6,9]
lisB=[1,6,5]
lisC=[5,6,3]
lisD=[11,14,12,15]
how can I write a function to compare lisB, lisC and lisD with lisA, if they
share two continuous elements (the order does not matter), then return 1,
otherwise return 0. For example, lisA, lisB and lisC have 5,6 or 6,5 so
these comparison will return 1 but the comparison between lisD and lisA
return 0.
--
Thanks!
Ben Bush
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20051114/56833dc4/attachment.html>


More information about the Python-list mailing list