the numlines argument of the more functionthe splitlines string object method call that this script employs returns list of substrings split at line ends ( ["line""line"]an alternative splitlines method does similar workbut retains an empty line at the end of the result if the last line is \ terminatedline 'aaa\nbbb\nccc\nline split('\ '['aaa''bbb''ccc'''line splitlines(['aaa''bbb''ccc'as we'll see more formally in the end-of-line character is normally always \ (which stands for byte usually having binary value of within python scriptno matter what platform it is run upon (if you don' already know why this mattersdos \ characters in text are dropped by default when read string method basics nowexample - is simple python programbut it already brings up three important topics that merit quick detours hereit uses string methodsreads from fileand is set up to be run or imported python string methods are not system-related tool per sebut they see action in most python programs in factthey are going to show up throughout this as well as those that followso here is quick review of some of the more useful tools in this set string methods include calls for searching and replacingmystr 'xxxspamxxxmystr find('spam' mystr 'xxaaxxaamystr replace('aa''spam''xxspamxxspamreturn first offset global replacement the find call returns the offset of the first occurrence of substringand replace does global search and replacement like all string operationsreplace returns new string instead of changing its subject in-place (recall that strings are immutablewith these methodssubstrings are just stringsin we'll also meet module called re that allows regular expression patterns to show up in searches and replacements in more recent pythonsthe in membership operator can often be used as an alternative to find if all we need is yes/no answer (it tests for substring' presencethere are also handful of methods for removing whitespace on the ends of strings--especially useful for lines of text read from filemystr 'xxxspamxxx'spamin mystr system tools substring search/test