Does Python have a string ‘contains’ substring method?

Use the in operator:

if "blah" not in somestring: 
    continue

Browse More Popular Posts

Leave a Comment