lxping 发表于 2022-11-16 21:15:55

列表推导式实现列表元素的平移复制

list_one = ["3","4","5","6","7","8","9","10","J","Q","K","1","2"]
list_double = []
) for i in range(2*len(list_one))]

list_double
['3', '3', '4', '4', '5', '5', '6', '6', '7', '7', '8', '8', '9', '9', '10', '10', 'J', 'J', 'Q', 'Q', 'K', 'K', '1', '1', '2', '2']
页: [1]
查看完整版本: 列表推导式实现列表元素的平移复制