Manipulate a number algorithim
<p>How can I fix this algo?</p>

<pre><code>def change_num(n, direc, numMove):
    if direc == 'back':
        nums = range(10)
        return nums[n-numMove]
    elif direc == 'forward':
        nums = range(10)
        nums.reverse()
        return nums[n-numMove]-1 
</code></pre>

<p>This doesn't work for direc == 'back'
here are some sample expected returns:</p>

<pre><code>0 1 2 3 4 5 6 7 8 9

change_num(1,'back', 5)  -&gt; 6
change_num(5,'back', 1)  -&gt; 4
change_num(7,'forward',5) -&gt; 2
change_num(0,'forward',5) -&gt; 5
</code></pre>

<p>Do you understand how the algo works? I'm just not implementing it right.
Thanks</p>
