Answers for "python string does not contain"

18

if substring not in string python

fullstring = "StackAbuse"
substring = "tack"

if fullstring.find(substring) != -1:
    print "Found!"
else:
    print "Not found!"
Posted by: Guest on May-01-2020
0

python string does not contain

str = '£35,000 per year'
# check for '£' character in the string
'£' not in str
# >> False
'£' in str
# >> True
Posted by: Guest on November-05-2020

Code answers related to "python string does not contain"

Python Answers by Framework

Browse Popular Code Answers by Language