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>You can do this in two separate ways but the way you are trying to do it will not work. You cannot have a variable that is not a list hold two values.</p>

<p>Solution 1: use two variables</p>

<pre><code>w1 = input("value1")
w2 = input("value2")
print(w1)
print(w2)
</code></pre>

<p>Solution 2: use a list</p>

<pre><code>w = []
w.append(input("value1"))
w.append(input("value2"))
print(w[0])
print(w[1])
</code></pre>

python