title: How does assignment work with list slices?
body: <p>Python docs says that slicing a list returns a new list.<br />
  Now if a &quot;new&quot; list is being returned I've the following questions related to &quot;Assignment to slices&quot;</p>
  <pre><code>a = [1, 2, 3]
  a[0:2] = [4, 5]
  print a
  </code></pre>
  <p>Now the output would be:</p>
  <pre><code>[4, 5, 3] 
  </code></pre>
  <ol>
  <li>How can something that is returning something come on the left side of expression?</li>
  <li>Yes, I read the docs and it says it is possible, now since slicing a list returns a &quot;new&quot; list, why is the original list being modified? I am not able to understand the mechanics behind it.</li>
  </ol>