该语句可以实现将range(5)中的序列每个重复3次
list = [x for x in [i for i in range(5)] for _ in range(3)]
output: [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]
该语句可以实现将range(5)中的序列每个重复3次
list = [x for x in [i for i in range(5)] for _ in range(3)]
output: [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]