>>> l = ['a', 'c', 'e', 'b']>>> [x for pair in zip(l,l) for x in pair]['a', 'a', 'c', 'c', 'e', 'e', 'b', 'b']
要么
>>> from itertools import repeat>>> [x for item in l for x in repeat(item, 2)]['a', 'a', 'c', 'c', 'e', 'e', 'b', 'b']
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)