mardi 22 septembre 2020

I don't understand why I am getting this result for substring matching in python [duplicate]

lets suppose I have a string

A = 'MRBTS-12696/GNBTS-1/GNBCF-1/GNCEL-2/TX_AXC-4163'

and I want that if

if 'LNCEL' and 'TX_AXC' in A:
    print('yes')
else:
    print('no')

It is printing yes where as it should just pass the condition and print no

I don't know if I am wrong or I am not getting the desired output. which is no.

as LNCEL is not in the string A.

Aucun commentaire:

Enregistrer un commentaire