#!/usr/bin/env python # # [SNIPPET_NAME: String contains string test] # [SNIPPET_CATEGORIES: Python Core] # [SNIPPET_DESCRIPTION: Test if a string contains another string] # [SNIPPET_AUTHOR: Jono Bacon ] # [SNIPPET_LICENSE: GPL] my_string = "abcdef" if "abc" in my_string: has_abc = True if has_abc == True: print "String contains string." #//python/2367