To use String.Contains in Python you can use the IN operator.

testString = "Hello World 2015"
if "World" not in testString:
print("World is not in String")
else:
print("World is in String")

2 thought on “How to do a string contains in Python”

Leave a Reply