I've this if statment that must check if this two string are present on self.line.lower()
that can be ex: 123abc567 or blaxyzbla:
if 'abc' or 'xyz' in self.line.lower():
print ('Present')
else:
print ('Not Present')
why this return me ever true(Print Present), if the self.line.lower()
doesn't contain the abc
or xyz
in the string?
I must use this to work:
if self.line.lower().find('abc') != -1:
print ('Present')
elif self.line.lower().find('xyz') != -1:
print ('Present')
else:
print ('Not Present')
Thanks a lot.