0

I want to create some variables in a for loop were the name is made from the iteration for example:

for i in range(10):
    f'a{i}'=list[i]

Now a1 should equal list[1] The above example is how I learned to do a similar thing with strings, but not sure how to do it for this, if it's even possible.

I'm new to stackoverflow and in general not that great in programming. I wasn't really sure how to phrase the question, so feel free to write how you would have asked it/called the title.

  • In general this is a bad idea, but as the linked duplicate shows, you can do something similar with dictionaries. – MattDMo Mar 30 '22 at 15:11

0 Answers0