That can be easily fixed:

def sublist(lst1, lst2):
        s1 = ','.join(map(str, lst1))
        s2 = ','.join(map(str, lst2))
        return False if s2.find(s1)==-1 else True

I don't know about best, but it works for the examples given.

For numbers, it will always work. But what about

lst1 = [",",",,"]
lst1 = [",",",",","]


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to