On 7/08/2013 6:50 PM, liuerfire Wang wrote:
> Here is a list x = [b, a, c] (a, b, c are elements of x. Each of them 
> are different type).  Now I wanna generate a new list as [b, b, a, a, c, c].

from itertools import chain

new_list = list(chain.from_iterable(zip(x,x)))
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to