0
a = ["one", "two", "three"]
b = ["three two", "four", "five"]

I just want to check if any element of list a is found within any elements of b, as a boolean result. Is there a more elegant way than having to loop both lists?

In this case, "three" is found in "three two", so it returns True.

Joan Venge
  • 315,713
  • 212
  • 479
  • 689

0 Answers0