I'm checking a string against a large list of strings (approx. 400k+). It seems to be running far quicker than I thought it would to check against these. As such, I want to count how many strings are being iterated through to check if it is functioning properly or not, checking against the full list before confirming a non-match.
My function operates like so:
if any(string_to_check in string for string in list_of_strings):
print("String Matched:" + string_to_check)
return True
else:
print("String Not Matched:" + string_to_check)
return False
How could I add to this, to see how many strings in the list_of_strings are iterated through before matching or not matching?
Thanks in advance.