What I want to do is pretty simple, I have a list list1 = [a,b,c,d]
and I want to create another variable called finalList=[[a,0],[b,0],[c,0],[d,0]]
Here's the code I did for this operation:
finalList = [["none",0]]*len(list1)
for i in range(len(list1)):
finalList[i][0] = list1[i]
finalList
this is the output I get:
[['30_39', 0],
['30_39', 0],
['30_39', 0],
['30_39', 0],
['30_39', 0],
['30_39', 0]]
knowing that the content of list1 is:
['Low_Class', '40_49', '50_59', 'Marital_Status', '60_plus', '30_39']
I don't know why it fills it with the last element only !!