la = ['A', 'B', 'C']
I'd like to create three empty lists with names corresponding to items in the list:
la_A = []
la_B = []
la_C = []
I tried
(l_la[i]) = ([] for i in len(la))
But not work.
la = ['A', 'B', 'C']
I'd like to create three empty lists with names corresponding to items in the list:
la_A = []
la_B = []
la_C = []
I tried
(l_la[i]) = ([] for i in len(la))
But not work.
You should use a dictionary instead
la = {c: [] for c in la}
print(la['A'])
prints
[]