
June 16, 2013
11:33 p.m.
File: http://docs.python.org/3.3/tutorial/introduction.html Section: 3.1.2. Strings There is a typo in this block ===BLOCK START=== In addition to indexing, slicing is also supported. While indexing is used to obtain individual characters, slicing allows you to obtain substring:
word[0:2] # characters from position 0 (included) to 2 (excluded)
'Py'
word[2:5] # characters from position 2 (included) to 4 (excluded) 'tho' ===BLOCK END=== The comment on the 2nd last line should read # characters from position 2 (included) to 5 (excluded)
Regards Neil
4270
Age (days ago)
4270
Last active (days ago)
0 comments
1 participants
participants (1)
-
Neil Kelleher