transforming a list into a string

jblazi jblazi at hotmail.com
Sat Jul 31 08:27:24 EDT 2004


Let us assume I have a list like

['1','2','7','8','12','13]

and would like to transoform it into the string

'{1,2},{7,8},{12,13}'

Which is the simplest way of achiebing this? (The list is in fact much
longer and I may have to cut the resulting strings into chunks of 100 or
so.)

TIA,

jb




More information about the Python-list mailing list