1
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.

LookIntoEast
  • 7,098
  • 16
  • 54
  • 84
  • This feels like an [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) to me. What are you trying to accomplish by doing this? – Chris Apr 25 '17 at 00:16

1 Answers1

1

You should use a dictionary instead

la = {c: [] for c in la}
print(la['A'])

prints

[]
Patrick Haugh
  • 55,247
  • 13
  • 83
  • 91