I have a list of strings, from which I want to locate every line that has \'http://\' in it, but does not have \'lulz\', \'lmfao\', \'.png\', or any other items in a list of str
Try this:
for s in strings:
if 'http://' in s and not 'lulz' in s and not 'lmfao' in s and not '.png' in s:
# found it
pass
Other option, if you need your options more flexible:
words = ('lmfao', '.png', 'lulz')
for s in strings:
if 'http://' in s and all(map(lambda x, y: x not in y, words, list(s * len(words))):
# found it
pass