'spam "{ :< }"{ :+ }format('ham''spam "ham "+ these operations are covered in core language resources such as learning python for the purposes of this thoughwe're interested in more powerful toolspython' string object methods include wide variety of text-processing utilities that go above and beyond string expression operators we saw some of these in action early on in and have been using them ever since for instancegiven an instance str of the built-in string object typeoperations like the following are provided as object method callsstr find(substrperforms substring searches str replace(oldnewperforms substring substitutions str split(delimiterchops up string around delimiter or whitespace str join(iterableputs substrings together with delimiters between str strip(removes leading and trailing whitespace str rstrip(removes trailing whitespace onlyif any str rjust(widthright-justifies string in fixed-width field str upper(converts to uppercase str isupper(tests whether the string is uppercase str isdigit(tests whether the string is all digit characters str endswith(substr-or-tupletests for substring (or tuple of alternativesat the end str startswith(substr-or-tupletests for substring (or tuple of alternativesat the front this list is representative but partialand some of these methods take additional optional arguments for the full list of string methodsrun dir(strcall at the python interactive prompt and run help(str methodon any method for some quick documentation the python library manual and reference books such as python pocket reference also include an exhaustive list string method utilities