Possible to slice a string with unpacked tuple?

python at bdurham.com python at bdurham.com
Sat Jan 24 17:31:14 EST 2009


Is there a way to slice a string with a tuple without unpacking
the tuple?
>>> myString = "111-222-333-444"
>>> myString[ 4: 7 ]
'222'
Is there some way I could perform an identical slicing operation
with a tuple like ( 4, 7 ) without having to unpack the tuple?
>>> myTuple = ( 4, 7 )
Thanks!
Malcolm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090124/37b8696a/attachment.html>


More information about the Python-list mailing list