<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt;&gt;&gt; s = [1,2,3]<br>
&gt;&gt;&gt; x = 5<br>
&gt;&gt;&gt; s[len(s):len(s)] = [x] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (1)</blockquote><div>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"></blockquote><br>

&gt;&gt;&gt; s<br>&nbsp;[1, 2, 3, 5]<br></div><br>When you did s[len(s):len(s)] you got the slice begining at len(s) with end at len(s) - 1, ie, nothing.<br><br>At step (1), len(s) = 3, so you did s[3:3] = [x]. It meant that the slice starting at index 3 (ie, just after s&#39; end) is (now) the list [x].<br>
When you did it again, you got slice s[4:4], which is empty.<br><br>[]&#39;s<br><br><br>Douglas<br><br>