How can I add some strings to a list that already exists in Python?
<pre><code>list1 = ['1', '2', '3', '4']
input_list = ['5', '6']
</code></pre>

<p>the out put I want is</p>

<pre><code>print(list1)
&gt;&gt; ['1','2','3','4','5']
&gt;&gt; ['1','2','3','4','6']
</code></pre>

<p>I tried many other things, but I couldn't get the result I want..
I also searched other Q&amp;As to find the way, but I couldn't find as well..
Thanks for your help!</p>

<p>How about this</p>

<pre><code>import copy

list1 = ['1', '2', '3', '4']
input_list = ['5', '6']

output = []
for e in input_list:
    l = copy.copy(list1)
    l.append(e)
    output.append(l)

print(output)
</code></pre>

<p>Result</p>

<pre><code>[['1', '2', '3', '4', '5'], ['1', '2', '3', '4', '6']]
</code></pre>

<p>The trick is <code>copy()</code> to make a new list</p>

python arrays list