Adding an element to a nested python list
<p>I am learning Python and am having trouble with lists. I want to create a list containing a nested list <code>e.g. a = [1, [2]]</code>. I then want to 'append' <code>4</code> to the nested list making <code>a[1,[2,4]]</code> and then insert <code>3</code> between <code>[2,4]</code> making <code>a[1,[2, 3, 4]]</code>.
<code>a.append(4)</code> does <code>[1,[2],4]</code>, I cannot find a way to achieve what I want.</p>