and shrink because they are immutable (the parentheses enclosing tuple' items can usually be omittedas done here) 'spam' [ [ [ ][ append( attributeerror'tupleobject has no attribute 'appendwhy tuplessowhy have type that is like listbut supports fewer operationsfranklytuples are not generally used as often as lists in practicebut their immutability is the whole point if you pass collection of objects around your program as listit can be changed anywhereif you use tupleit cannot that istuples provide sort of integrity constraint that is convenient in programs larger than those we'll write here we'll talk more about tuples later in the bookincluding an extension that builds upon them called named tuples for nowthoughlet' jump ahead to our last major core typethe file files file objects are python code' main interface to external files on your computer they can be used to read and write text memosaudio clipsexcel documentssaved email messagesand whatever else you happen to have stored on your machine files are core typebut they're something of an oddball--there is no specific literal syntax for creating them ratherto create file objectyou call the built-in open functionpassing in an external filename and an optional processing mode as strings for exampleto create text output fileyou would pass in its name and the 'wprocessing mode string to write dataf open('data txt'' ' write('hello\ ' write('world\ ' close(make new file in output mode ('wis writewrite strings of characters to it return number of items written in python close to flush output buffers to disk this creates file in the current directory and writes text to it (the filename can be full directory path if you need to access file elsewhere on your computerto read back what you just wrotereopen the file in 'rprocessing modefor reading text input --this is the default if you omit the mode in the call then read the file' content into stringand display it file' contents are always string in your scriptregardless of the type of data the file contains introducing python object types