Is there a more efficient way to compare a list of strings rather than using a for loops?
I would like to check the existence of x strings in y (at any part of y strings).
x = ['a1' , 'a2', 'bk']
y = ['a1aa' , 'a2lop' , 'bnkl', 'a1sss', 'flask']
for i in x:
print([i in str_y for str_y in y])
Results:
[True, False, False, True, False]
[False, True, False, False, False]
[False, False, False, False, False]