使用find进行模拟操作 s = "This be a string" if s . find ( "is" ) == - 1 : print "No 'is' here!" else : print "Found 'is' in the string."