How to store values retrieved from a loop in different variables in Python?
<p>Just a quick question.<br>
Suppose, I have a simple for-loop like  </p>

<pre><code>for i in range(1,11):
    x = raw_input() 
</code></pre>

<p>and I want to store all the values of <em>x</em> that I will be getting throughout the loop in <em>different variables</em> such that I can use all these <em>different variables</em> later on when the loop is over.</p>

<p>You can store each input in a list, then access them later when you want.</p>

<pre><code>inputs = []
for i in range(1,11);
    x = raw_input()
    inputs.append(x)


# print all inputs
for inp in inputs:
    print(inp)

# Access a specific input
print(inp[0])
print(inp[1])
</code></pre>

python python-2.7 for-loop iteration