You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d2f5466
Browse filesBrowse the repository at this point in the historyBrowse files
"description": "This lesson was derived from Section 3.2 of <a href='http://www.diveintopython.net/native_data_types/lists.html'>Dive Into Python</a>.",
13
13
14
-
"2": "First, you define a list of five elements. Note that they retain their original order. This is not an accident. A list is an ordered set of elements enclosed in square brackets.",
14
+
"1": "First, you define a list of five elements. Note that they retain their original order. This is not an accident. A list is an ordered set of elements enclosed in square brackets.",
15
15
16
-
"3": "You can get a subset of a list, called a \"slice\", by specifying two indices. The return value is a new list containing all the elements of the list, in order, starting with the first slice index (in this case <code>li[1]</code>), up to but not including the second slice index (in this case <code>li[3]</code>).",
16
+
"2": "You can get a subset of a list, called a \"slice\", by specifying two indices. The return value is a new list containing all the elements of the list, in order, starting with the first slice index (in this case <code>li[1]</code>), up to but not including the second slice index (in this case <code>li[3]</code>).",
17
17
18
-
"4": "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 element you want, and the second slice index specifies the first element you don't want. The return value is everything in between.",
18
+
"3": "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 element you want, and the second slice index specifies the first element you don't want. The return value is everything in between.",
19
19
20
-
"5": "Lists are zero-based, so <code>li[0:3]</code> returns the first three elements of the list, starting at <code>li[0]</code>, up to but not including <code>li[3]</code>.",
20
+
"4": "Lists are zero-based, so <code>li[0:3]</code> returns the first three elements of the list, starting at <code>li[0]</code>, up to but not including <code>li[3]</code>.",
21
21
22
-
"6": "<code>append</code> adds a single element to the end of the list.",
22
+
"5": "<code>append</code> adds a single element to the end of the list.",
23
23
24
-
"7": "<code>insert</code> inserts a single element into a list. The numeric argument is the index of the first element that gets bumped out of position. Note that list elements do not need to be unique; there are now two separate elements with the value '<code>new</code>', <code>li[2]</code> and <code>li[6]</code>.",
24
+
"6": "<code>insert</code> inserts a single element into a list. The numeric argument is the index of the first element that gets bumped out of position. Note that list elements do not need to be unique; there are now two separate elements with the value '<code>new</code>', <code>li[2]</code> and <code>li[6]</code>.",
25
25
26
-
"8": "<code>extend</code> concatenates lists. Note that you do not call <code>extend</code> with multiple arguments; you call it with one argument, a list. In this case, that list has two elements."
26
+
"7": "<code>extend</code> concatenates lists. Note that you do not call <code>extend</code> with multiple arguments; you call it with one argument, a list. In this case, that list has two elements."
0 commit comments