0

I need to create some dicts with variable names. This works perfectly with this line:

for i in range(0,5):
    locals()['dict{}'.format(i)] = {}

But how can I access on of these dictionaries?

1 Answers1

0

Nevermind, it was just as easy as this:

 i = 0
 print(locals()['dict{}'.format(i)])