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
  • 8,048
  • 18
  • 64
  • 92
  • 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? – ChrisGPT was on strike 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
  • 59,226
  • 13
  • 88
  • 96