sunstring

Remco Gerlich scarblac at pino.selwerd.nl
Sun Mar 17 15:21:17 EST 2002


Billy Ng <evebill8 at hotmail.com> wrote in comp.lang.python:
> Would anybody tell me how to do substring in python?

Slicing:

x = "abcdefghijklm"

def = x[3:6]   # "def"

Like all indexing in Python, it starts at 0, and does not include the
endpoint. 

-- 
Remco Gerlich



More information about the Python-list mailing list