#!/usr/bin/python str1 = "this is string example"; str2 = "is"; if str1.find(str2) != -1: print "found" #Its quite easier to go with 'in' operator for string too. if str2 in str1: print "found"