Correction in PYTHON 3 Doc tutorial.pdf
Hi team, I downloaded the doc from below URL: https://docs.python.org/3/download.html PDF (A4 paper size) Download <https://docs.python.org/3/archives/python-3.5.1-docs-pdf-a4.zip> (ca. 8 MB) I downloaded the packed as .zip file & unzipped it and started with docs-pdf/tutorial.pdf 3.1.3 Lists: At page No: 12 letters[2:5] = ['C', 'D', 'E'] should be corrected to letters[2:4] = ['C', 'D', 'E'] Thanks, Amir Malik, Mobile: +91-9971509933
Hi Amir, On Fri, Mar 25, 2016 at 12:54 AM, amir malik <amirmalik.007@gmail.com> wrote:
Hi team,
I downloaded the doc from below URL: https://docs.python.org/3/download.html
PDF (A4 paper size)Download (ca. 8 MB)
I downloaded the packed as .zip file & unzipped it and started with docs-pdf/tutorial.pdf
3.1.3 Lists:
At page No: 12
More simply, this is at https://docs.python.org/3/tutorial/introduction.html#lists
letters[2:5] = ['C', 'D', 'E']
should be corrected to letters[2:4] = ['C', 'D', 'E']
This is actually correct as written. Try it!
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] letters[2:5] ['c', 'd', 'e'] letters[2:5] = ['C', 'D', 'E'] letters ['a', 'b', 'C', 'D', 'E', 'f', 'g'] letters[2:4] = ['c', 'd', 'e'] letters ['a', 'b', 'c', 'd', 'e', 'E', 'f', 'g']
Remember that in Python, slicing ([2:5]) means "start at position 2, and give me everything up to (but not including) 5", which yields the values at indexes 2, 3, and 4. Thanks for the report anyway, we do appreciate it. Regards, -- Zach
participants (2)
-
amir malik
-
Zachary Ware