From at home writes: > if 'one' and 'two' in f: > alist.append(f) Use: if 'one' in f and 'two' in f: ...