list({keys()[[keys(traceback (innermost last)file ""line in attributeerrorkeys [][:[""[:'list(needed in xnot string indexing this is bit of trick question--because strings are collections of one-character stringsevery time you index stringyou get back string that can be indexed again [ ][ ][ ][ ][ just keeps indexing the first character over and over this generally doesn' work for lists (lists can hold arbitrary objectsunless the list contains stringss "spams[ ][ ][ ][ ][ 'sl [' '' ' [ ][ ][ ' immutable types either of the following solutions works index assignment doesn'tbecause strings are immutables "spams [ 'ls[ : 'slams [ 'ls[ [ 'slam(see also the python and bytearray string type in --it' mutable sequence of small integers that is essentially processed the same as string nesting here is sampleme {'name':('john'' ''doe')'age':'?''job':'engineer'me['job''engineerme['name'][ 'doe files here' one way to create and read back text file in python (ls is unix commanduse dir on windows)filemaker py file open('myfile txt'' 'file write('hello file world!\ 'file close(oropen(write(close not always needed filereader py file open('myfile txt''ris default open mode appendix dsolutions to end-of-part exercises