character strings in python string is sequence of characters that come from some alphabet in pythonthe built-in str class represents strings based upon the unicode international character seta -bit character encoding that covers most written languages unicode is an extension of the -bit ascii character set that includes the basic latin alphabetnumeralsand common symbols strings are particularly important in most programming applicationsas text is often used for input and output basic introduction to the str class was provided in section including use of string literalssuch as hello and the syntax str(objthat is used to construct string representation of typical object common operators that are supported by stringssuch as the use of for concatenationwere further discussed in section this appendix serves as more detailed referencedescribing convenient behaviors that strings support for the processing of text to organize our overview of the str class behaviorswe group them into the following broad categories of functionality searching for substrings the operator syntaxpattern in scan be used to determine if the given pattern occurs as substring of string table describes several related methods that determine the number of such occurrencesand the index at which the leftmost or rightmost such occurrence begins each of the functions in this table accepts two optional parametersstart and endwhich are indices that effectively restrict the search to the implicit slice [start:endfor examplethe call find(pattern restricts the search to [ calling syntax count(patterns find(patterns index(patterns rfind(patterns rindex(patterndescription return the number of non-overlapping occurrences of pattern return the index starting the leftmost occurrence of patternelse - similar to findbut raise valueerror if not found return the index starting the rightmost occurrence of patternelse - similar to rfindbut raise valueerror if not found table methods that search for substrings