From 42e279c148f579355c0e0a1715cfc4a3d80227ec Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Thu, 18 Jun 2009 00:16:30 -0400 Subject: [PATCH] typos [h/t G.P.] --- native-datatypes.html | 2 +- your-first-python-program.html | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/native-datatypes.html b/native-datatypes.html index 317d7e2..8fa0ba0 100644 --- a/native-datatypes.html +++ b/native-datatypes.html @@ -234,7 +234,7 @@ body{counter-reset:h1 2} >>> a_list[3:] ['z', 'example'] >>> a_list[:] -['a', 'b', 'mpilgrim', 'z', 'example'] +['a', 'b', 'mpilgrim', 'z', 'example']
  1. You can get a part of a list, called a “slice”, 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 a_list[1]), up to but not including the second slice index (in this case a_list[3]).
  2. 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’t want. The return value is everything in between. diff --git a/your-first-python-program.html b/your-first-python-program.html index 79a3e17..f387107 100644 --- a/your-first-python-program.html +++ b/your-first-python-program.html @@ -4,7 +4,6 @@ Your first Python program - Dive into Python 3 -