I think a comment in the code explaining the format (maybe more expanded) would be ideal. Also, please build strings with ''.join(list_of_strings), it takes linear time instead of quadratic.