Check whether a Python string contains another string

Python

To test whether a given python string contains another string, you can use python's 'in' operator as shown below:

mystring = "The white fox jumped over the brown fence."

if "fence" in mystring:    print("it's in the string")
it's in the string
mystring = "The white fox jumped over the brown fence."

if "blue" not in mystring:    print("it's not in the string")
it's not in the string