View Single Post
Posts: 136 | Thanked: 150 times | Joined on Dec 2010 @ Finland
#2
http://docs.python.org/release/1.5.1p1/tut/strings.html
Slice indices have useful defaults; an omitted first index defaults to zero, an omitted second index defaults to the size of the string being sliced.

>>> word[:2] # The first two characters
'He'
>>> word[2:] # All but the first two characters
 

The Following User Says Thank You to mooglez For This Useful Post: