I can do such thing in python:
l = ['one', 'two', 'three']
if 'some word' in l:
...
This will check if ‘some word’ exists in the list. But can I do reverse thing?
l = ['one', 'two', 'three']
if l in 'some one long two phrase three':
...
I have to check whether some words from array are in the string. I can do this using cycle but this way has more lines of code.
1 Answer