Try the following:
for s in strings: if 'http://' in s and not 'lulz' in s and not 'lmfao' in s and not '.png' in s:
Another option if you need your more flexible options:
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))):
source share