silly idea - interesting problem
Steven D. Majewski
sdm7g at Virginia.EDU
Sat Oct 20 11:17:47 EDT 2001
On Sat, 20 Oct 2001, Stefan Antoni wrote:
>
> i got a silly idea about a small script which takes to strings (lets say
> "test" and "dust") and mixes them to "tdeusstt".
> i tried to code it because i thought it would be easy, but now i cannot
> find out _how_ to do it ;)
>
> i tried to "list()" the string and mix the items. but ...
>
> Anybody has a hint or even a solution?
>>> import operator
>>> reduce( operator.__add__, map( operator.__add__, 'test', 'dust' ), '' )
'tdeusstt'
-- Steve
More information about the Python-list
mailing list