There are various legal things that you can do, and no one has been given to say which one is right without knowing which one you need.
At first you can simply write str or repr from a :
>>> a=[[1, 2, "hello"],[3, 5, "hi There"],[5,7,"I don't know"]] >>> repr(a) '[[1, 2, \'hello\'], [3, 5, \'hi There\'], [5, 7, "I don\'t know"]]'
Note that this is what print does (it prints str of what you give it), although str is identical to repr , both are effectively '[' + ', '.join(map(repr, self)) + ']' ).
Secondly, you can use a format designed for persistent data storage, for example JSON:
>>> json.dumps(a) '[[1, 2, "hello"], [3, 5, "hi There"], [5, 7, "I don\'t know"]]'
Thirdly, you can combine the representation of each element a some way of your choice, which is trivial with map or understanding. For instance:
>>> '[' + ', '.join(map(repr, a)) + ']' '[[1, 2, \'hello\'], [3, 5, \'hi There\'], [5, 7, "I don\'t know"]]'
... or...
>>> 'My stuff includes: ' + ','.join(map(repr, a)) + '\n' 'My stuff includes: [1, 2, \'hello\'],[3, 5, \'hi There\'],[5, 7, "I don\'t know"]\n'
Or you can do the same recursively.
Or you can flatten the list (for example, hide it one step with itertools.chain or recursively with recipes from itertools documents or with the more-itertools ), and then run the line, but you want, and then join them.
Or you can just write the word LIST .
All these are absolutely correct things to pass to write .