"a"+str(1)=2
File "<ipython-input-44-929460161ba7>", line 1
"a"+str(1)=2
^
SyntaxError: can not assign to operator
I want to create a series of variables a1 a2 a3 an and then associate with a value each
"a"+str(1)=2
File "<ipython-input-44-929460161ba7>", line 1
"a"+str(1)=2
^
SyntaxError: can not assign to operator
I want to create a series of variables a1 a2 a3 an and then associate with a value each
Make a list instead of trying to create variables programmatically (which is possible but not a good idea):
a =[]
a[1] = 2
I believe this is what you want to do.