This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python Tutorial 3.1.4 List example
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: elsiebeth, hyeshik.chang
Priority: low Keywords:

Created on 2004-08-21 02:29 by elsiebeth, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg22154 - (view) Author: Elizibeth Thompson (elsiebeth) Date: 2004-08-21 02:29
In chapter 3.1.4, there is an example of making and
using a list.  One of the examples is:

>>> a = ['spam', 'eggs', 100, 1234]

>>> a[1:-1]
['eggs', 100]

I didn't type this into Python, but I think that it
should be:

>>> a[1:-1]
['eggs', 1234]

Thanks.
msg22155 - (view) Author: Hyeshik Chang (hyeshik.chang) * (Python committer) Date: 2004-08-21 04:28
Logged In: YES 
user_id=55188

No. ['eggs', 100] is correct.
[1:-1] means not 1 and -1 but from 1 to -1.
msg22156 - (view) Author: Elizibeth Thompson (elsiebeth) Date: 2004-08-21 20:03
Logged In: YES 
user_id=914980

Sorry 'bout that. :)
History
Date User Action Args
2022-04-11 14:56:06adminsetgithub: 40796
2004-08-21 02:29:11elsiebethcreate