Python - String and int variable concat followed by value substitution : <p>I have a list of variables in Python with below values.</p>

<p>I am trying to print the values of these variables in the following manner, but this is unsuccessful. Can someone please help with a solution ?</p>

<pre><code>a1=1
a2=2
a3=3
for i in range(1,4):
  temp="a"+str(i)
  print(temp)
</code></pre>

<p>I want the output in 'temp' print the values(viz) 1,2,3 whereas the output seen are the variables (viz) a1,a2,a3</p>
