Tip: Check if List Contains a Substring in Python

filter = "substring to check"
row = ["list", "to", "check", "against"]
contains = sum(1 for x in row if filter in str(x))

or case insensitive

filter = "substring to check".lower()
row = ["list", "to", "check", "against"]
contains = sum(1 for x in row if filter in str(x).lower())


To contact me, send an email anytime or leave a comment below.