I think the solution here is trivial, but I cant get it. How to match a string against a list item? No matter how many list items match, it should just return True (or False if there is no match).
Below code returns True:
txt = ["to","do","list","to","test","it"]
x = "to"
if x in txt:
print("match")
else:
print("no match")
But this one returns False:
txt = ["to,do,list","to,test,it"]
x = "to"
if x in txt:
print("match")
else:
print("no match")
This also returns false:
txt = ["todolist","totestit"]
x = "to"
if x in txt:
print("match")
else:
print("no match")