a possibly foolish question about slices
Andrew Koenig
ark at research.att.com
Fri Jun 14 13:50:09 EDT 2002
Suppose x is a string or list, and I want to refer to
a subsequence of x with length n starting at position p.
under the assumption that this subsequence is entirely
To do so, I can use x[p:p+n] in all circumstances but one,
namely when p < 0 and p == -n. Is there a similarly concise
expression that works even in this special case?
--
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark
More information about the Python-list
mailing list