typos [h/t G.P.]

This commit is contained in:
Mark Pilgrim
2009-06-18 00:16:30 -04:00
parent b0f4e357fe
commit 42e279c148
2 changed files with 1 additions and 2 deletions
+1 -1
View File
@@ -234,7 +234,7 @@ body{counter-reset:h1 2}
<a><samp class=p>>>> </samp><kbd class=pp>a_list[3:]</kbd> <span class=u>&#x2464;</span></a>
<samp class=pp>['z', 'example']</samp>
<a><samp class=p>>>> </samp><kbd class=pp>a_list[:]</kbd> <span class=u>&#x2465;</span></a>
['a', 'b', 'mpilgrim', 'z', 'example']</pre>
<samp class=pp>['a', 'b', 'mpilgrim', 'z', 'example']</samp></pre>
<ol>
<li>You can get a part of a list, called a &#8220;slice&#8221;, by specifying two indices. The return value is a new list containing all the items of the list, in order, starting with the first slice index (in this case <code>a_list[1]</code>), up to but not including the second slice index (in this case <code>a_list[3]</code>).
<li>Slicing works if one or both of the slice indices is negative. If it helps, you can think of it this way: reading the list from left to right, the first slice index specifies the first item you want, and the second slice index specifies the first item you don&#8217;t want. The return value is everything in between.
-1
View File
@@ -4,7 +4,6 @@
<title>Your first Python program - Dive into Python 3</title>
<!--[if IE]><script src=j/html5.js></script><![endif]-->
<link rel=stylesheet href=dip3.css>
<link rel=stylesheet href=prettify.css>
<style>
body{counter-reset:h1 1}
table{border:1px solid #bbb;border-collapse:collapse;margin:auto}