Finding text in a string

Hi there,
I have two kinds of string that could be given to my function:

23:46 PART SET    K22
07:02 UNSET       USR027 ABC    M22 L3.6

I want to be able to find events from these strings with my script.
(eg logList = [“UNSET”, “PART SET”, “SET”, “KSW SET”, “KSW UNSET”, “ABORT SET”, “BEGIN SET”])

I have tried in, but no luck.

Thanks!

Can you show us exactly what you tried? in appears to work for me:

>>> 'PART SET' in '23:46 PART SET    K22'
True
if(line in emailList):
    DEBUG("EMAIL THIS",2)
    decipher_act(line, 1)

#######

for i in range(len(emailList)):
    if emailList[i] in line:
        decipher_act(line,1)
        break

Both do not trigger the function or DEBUG.

One problem I can foresee is that there might be times where two strings have partially same contents, like UNSET and KSW UNSET.

@steven.daprano Ignore my last post! I’ve realised I was looking too high when I actually may have had my basics wrong.
The working code is:

for i in range(len(List)):
if(List[i] in line) == True:
    print(List[i])

Thank you!