Use the in keyword without is.
if "x" in dog:
print "Yes!"
If you’d like to check for the non-existence of a character, use not in:
if "x" not in dog:
print "No!"
Use the in keyword without is.
if "x" in dog:
print "Yes!"
If you’d like to check for the non-existence of a character, use not in:
if "x" not in dog:
print "No!"