How do you store two different inputs from the same variable?
<p>Had to delete most (of shown script). The code was a major part of my coursework, thus i'd rather others wouldn't see it and try to copy the majority of my code. I can leave the relevant part to the question though.</p>

<pre><code>while n == 1:
    w = input("Input the product code: ")
</code></pre>

<p>As I said can't show the rest of the code. When a certain condition is met, then n is set to 0.<br>
Problem is that when a new code for w is entered, w is overwritten. For example, if w = 24, then w = 54, if you print(w) it will just print 54, since it's the latest input. How do you make it so that it prints all inputs for w?
<strong><em>FOR ALL YOU AWESOME PEOPLE THAT CONTRIBUTED THANK YOU!!</em></strong></p>

<p>Use a container type instead of a single variable. In this case, <code>list()</code> would seem appropriate:</p>

<pre><code>inputs = [] # use a list to add each input value to
while n == 1:
    inputs.append(input("Input the product code: ")) # each time the user inputs a string, added it to the inputs list
for i in inputs: # for each item in the inputs list
    print(i) # print the item
</code></pre>

<p><strong>Note:</strong> The above code will not compile. You need to fill in the value for the variable <code>n</code>.</p>

python