Python function returns None, unclear why
<p>I am pretty new to python and am hitting an issue I cannot explain. I have tried searching through the forum answers here, but what I am finding does not match up with my situation. It feels like I am missing something pretty basic, but I'm not seeing it (obviously...)</p>

<p>This code runs the way I expect:</p>

<pre><code>import string

mults = [1,2,3,4,6,7,9,10,12,15,16,19,21,22,24]

def factor_exp(lst):
    if lst[-1] == 1:
        lst.pop()
        return lst+[1]
    if lst[-1] == 2:
        lst.pop()
        return lst+[1,1]
    else:
        return "Should never get here"

print factor_exp([1])
print factor_exp([2])
print factor_exp([1,2])
</code></pre>

<p>This returns:</p>

<pre><code>&gt;&gt;&gt; 
[1]
[1, 1]
[1, 1, 1]
</code></pre>

<p>Which is what I want.</p>

<p>I thought using append and extend on the list inside the function would work also. One "append" added near the bottom of the code.</p>

<pre><code>import string

mults = [1,2,3,4,6,7,9,10,12,15,16,19,21,22,24]

def factor_exp(lst):
    if lst[-1] == 1:
        lst.pop()
        return lst+[1]
    if lst[-1] == 2:
        lst.pop()
        return lst.append([1,1])
    else:
        return "Should never get here"


print factor_exp([1])
print factor_exp([2])
print factor_exp([1,2])
</code></pre>

<p>But this returns:</p>

<pre><code>&gt;&gt;&gt; 
[1]
None
None
</code></pre>

<p>Why are the "None's" appearing? Thanks in advance for any help or insights.</p>
