Your function is fine but if you didn&#x27;t want it to affect the original list you could do something like:<p><pre><code>    def sum(lst):
       if lst:
           return lst[0] + sum(lst[1:])
       return 0</code></pre>