"Demel, Jeff" <Jeff.Demel at JavelinDirect.com> wrote in message
news:mailman.764.1161275760.11739.python-list at python.org...
John Salerno wrote:
P.S. How about a string.shuffle() method that splits the string in half
into two new strings str1 and str2, and then recompiles the string by
alternating one character from each str1 and str2 as it goes? Like
shuffling cards. ;)
You mean:
"".join(sum(map(list,zip(s,s[len(s)/2:])),[]))
perhaps?
>>> s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
>>> "".join(sum(map(list,zip(s,s[len(s)/2:])),[]))
'ANBOCPDQERFSGTHUIVJWKXLYMZ'
>>>
-- Paul