If I have this:
a=\'abcdefghij\' b=\'de\'
Then this finds b in a:
b in a => True
Is there a way of doi
I suspect there are more pythonic ways of doing it, but at least it gets the job done:
l=list('abcdefgh') pat=list('de') print pat in l # Returns False print any(l[i:i+len(pat)]==pat for i in xrange(len(l)-len(pat)+1))