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>Use extend to add a list to another list, append to add a element to a list.</p>

<pre><code>list1.extend(input_list)
list1.append('5')
list1.append('6')
</code></pre>

python arrays list