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: fix
Type: Stage: resolved
Components: Versions: Python 3.8
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: steven.daprano, xtreak
Priority: normal Keywords:

Created on 2020-08-30 12:22 by weagjoigjowe, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg376104 - (view) Author: ogwjoigwejoie (weagjoigjowe) Date: 2020-08-30 12:22
Hi, I found a problem with this address
https://docs.python.org/3/tutorial/introduction.html#strings

In here
>>> word[0:2]  # characters from position 0 (included) to 2 (excluded)
'Py'
>>> word[2:5]  # characters from position 2 (included) to 5 (excluded)
'tho'

In the second example word[2:5] becomes 'hto'
msg376105 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2020-08-30 12:40
Closing this as not a bug since the example seems to be correct. Feel free to reopen with more details if needed.
msg376107 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2020-08-30 13:17
I agree with xtreak. I guess you probably misspelled the initial word:

>>> 'Python'[2:5]  # same as the tutorial
'tho'

>>> 'Pyhton'[2:5]  # misspelling
'hto'
History
Date User Action Args
2022-04-11 14:59:35adminsetgithub: 85832
2020-08-30 13:17:16steven.dapranosetnosy: + steven.daprano
messages: + msg376107
2020-08-30 12:40:24xtreaksetstatus: open -> closed

nosy: + xtreak
messages: + msg376105

resolution: not a bug
stage: resolved
2020-08-30 12:30:08weagjoigjowesettitle: Problem in tutorial/introduction.html#strings -> fix
2020-08-30 12:29:15weagjoigjowesetnosy: - weagjoigjowe
-> (no value)
2020-08-30 12:22:16weagjoigjowecreate