list=[[AA,'1'] ,[BB,'4'] ,['CC','3']]
I want expand list[0] of count list[1]
Expected output: ['AA','BB','BB','BB','BB','CC','CC','CC']
I try below 2 ways but not works... Please could tell me where i need to fix?
⓵
variableName = []
for row in rows:
vName = row[0]
count = int(row[1])
result = Counter(vName=count)
variableName.append(list(result.elements()))
⓶
variableName = []
for row in rows:
vName = row[0]
count = int(row[1])
while count < countRW:
variableName.append(vName)
[i for i, n in list1 for _ in range(int(n))]?