I have a set of characters: \\,/,?,% etc. I also have a string, lets say \"This is my string % my string ?\"
I want to check if any of the characters are present in
You could use any here.
>>> string = r"/\?%" >>> test = "This is my string % my string ?" >>> any(elem in test for elem in string) True >>> test2 = "Just a test string" >>> any(elem in test2 for elem in string) False