On 8/23/07, J. Cliff Dyer <[EMAIL PROTECTED]> wrote:
>
>  What do you want to have happen in this case?
>
> my_list = [ 'a', 4, 'c' ]
>


It depends on the requirements of the OP.
A possible solution could be:

my_second_list = []
try:
    my_second_list.append("".join(my_list))
except TypeError:
    my_second_list.append("".join(str(item) for item in my_list) )


But it depends on the the actual requirements, maybe it isn't meaningful for
the original list to contain numbers (think for instance of nucleotide
sequences...?)

Francesco
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to