text files and lines text file can be thought of as sequence of linesmuch like python string can be thought of as sequence of characters for examplethis is sample of text file which records mail activity from various individuals in an open source project development teamfrom stephen marquard@uct ac za sat jan : : return-pathdatesat jan : : - tosource@collab sakaiproject org fromstephen marquard@uct ac za subject[sakaisvn commitr content/branchesdetailsthe entire file of mail interactions is available from www py com/code /mbox txt and shortened version of the file is available from www py com/code /mbox-short txt these files are in standard format for file containing multiple mail messages the lines which start with "fromseparate the messages and the lines which start with "from:are part of the messages for more information about the mbox formatsee to break the file into linesthere is special character that represents the "end of the linecalled the newline character in pythonwe represent the newline character as backslash- in string constants even though this looks like two charactersit is actually single character when we look at the variable by entering "stuffin the interpreterit shows us the \ in the stringbut when we use print to show the stringwe see the string broken into two lines by the newline character stuff 'hello\nworld!stuff 'hello\nworld!print(stuffhello worldstuff ' \nyprint(stuffx len(stuff you can also see that the length of the string \ny is three characters because the newline character is single character