if any(x in string_to_search for x in listThat_contains_x): print(x)
Here is what the above code is Doing:
1. It’s creating a list called listThat_contains_x.
2. It’s creating a string called string_to_search.
3. It’s using a for loop to iterate through the list called listThat_contains_x.
4. It’s using an if statement to check if the string called string_to_search contains any of the items in the list called listThat_contains_x.
5. If the string called string_to_search does contain any of the items in the list called listThat_contains_x, then it will print out the item that it found.