I am trying to write part of a script that will evaluate whether or not any of two (or more) given characters are present in a string. It seems that the logical OR operator is always true in my IF/IN sentence. Any ideas?
#!/usr/bin/python
mylist = ['abc', 'def']
for mystring in mylist:
if 'a' in mystring:
print mystring
if 'a' or 'b' in mystring:
print mystring
prints:
abc
abc
def