Author tegridycode
Recipients tegridycode
Date 2021-01-30.08:13:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1611994418.49.0.767343252792.issue43076@roundup.psfhosted.org>
In-reply-to
Content
The following code ran in Google Colab...

=====================================

import sys

print (sys.version)

string = 'WORD=BIRD\nBIRD\nBIRD'

print(string.split())

print('========')

print(string.split('=')[0][0:3])
print(string.split('=')[1][0:3])

=================================

produces this...

=================================

3.6.9 (default, Oct  8 2020, 12:12:24) 
[GCC 8.4.0]
['WORD=BIRD', 'BIRD', 'BIRD']
========
WOR
BIR

=================================

Shouldn't index [0:3] give 4 chars? I looked in the docs and I could not find anything explaining this behavior.

=================================

Thanks.
History
Date User Action Args
2021-01-30 08:13:38tegridycodesetrecipients: + tegridycode
2021-01-30 08:13:38tegridycodesetmessageid: <1611994418.49.0.767343252792.issue43076@roundup.psfhosted.org>
2021-01-30 08:13:38tegridycodelinkissue43076 messages
2021-01-30 08:13:38tegridycodecreate