title: Basic python. How to forbid functions to change the list?
body: <pre><code>&gt;&gt;&gt; def test():
  ...    a.remove(1)
  &gt;&gt;&gt; a = [1,2]
  &gt;&gt;&gt; test()
  &gt;&gt;&gt; print a 
  [2]
  </code></pre>
  
  <p>Why does <code>a</code> equal <code>[2]</code> rather than <code>[1,2]</code>?</p>