substring or slice of or more consecutive characters of string may be referred to by specifying starting index and the index one past the last character of the substring if the starting or ending index is left out python uses and the length of the string respectively python assumes indices that would be beyond an end of the string actually mean the end of the string (cstring methodsassume refers to string upper(returns an uppercase version of the string [object orientation (page )ii lower(returns lowercase version of the string [object orientation (page )iii countsub returns the number of repetitions of the substring sub inside [object orientation (page )iv findsub findsub start findsub start end returns the index in of the first character of the first occurrence of the substring sub within the part of the string indicatedrespectively the whole string sor sstart ]or sstart end ]where start and end have integer values [object orientation (page ) split( splitsep the first version splits at any sequence of whitespace (blanksnewlinestabsand returns the remaining parts of as list if string sep is specifiedit is the separator that gets removed from between the parts of the list [split (page )vi sep joinsequence return new string obtained by joining together the sequence of strings into one stringinterleaving the string sep between sequence elements [join (page )vii further string methods are discussed in the python reference manualin the section on built-in types [further exploration (page ) sets set is collection of elements with no repetitions it can be used as sequence in for loop set constructor can take any other sequence as parameterand convert the sequence to set (with no repetitionsnonempty set literals are enclosed in braces [sets (page ) list method append alist appendelement add an arbitrary element to the end of the list alistmutating the listnot returning any list [appending to list (page ) files [files (page )(aopennameinfilesystem opennameinfilesystem 'rreturns file object for readingwhere nameinfilesystem must be string referring to an existing file (bopennameinfilesystem ' ' objects and methods