0

This is not a real world problem. Just out of curiosity question.

I would like to store the out put from a for loop to a numbered list. So, Basically my doubt is how I can create a numbered or ordered lists in a loop?

Pseudo-code:

y = range(26)

for i in y:
    i = a new list named as 'a'

At the end I should have 26 lists, like below:

a = [] b = [] : : z = []

  • don't create lists with unique names but keep them in dictionary or in other list. It is simpler to create and later it is simpler to use. – furas May 15 '22 at 19:36
  • I am not sure about the grasping sense of moderator. the answer he marked has no connection with my question. – user3384929 May 16 '22 at 18:50
  • marked answer has big connection with your question - preferred solution for your question is NOT create variables but use dictionary. `my_data = dict()` and later `my_data["a"] = []`, `my_data["b"] = []` ... `my_data["z"] = []` – furas May 16 '22 at 19:58

0 Answers0