list 元素个数*10 生成一个新的list

# 方式一
a = ['ad','bc']
import operator
from functools import reduce
new_list = [[x] * 10 for x in a]
list2 = reduce(operator.add, new_list)
print(list2)

# 方式二
c = ['ad', 'bc']
d = [i for j in c for i in [j]*10]
print(d)
posted @ 2020-10-12 09:20  不可描述的细节  阅读(466)  评论(0)    收藏  举报