[Tutor] Adding index numbers to tuple
timomlists at gmail.com
Tue Aug 16 15:10:53 CEST 2011
Maybe a bit confusing topic title, probably the example will do.
I have a tuple:
t = ('a', 'b', 'c', 'd')
And need the following output, list or tuple, doesn't matter:
(0, 'a', 1, 'b', 2, 'c', 3, 'd')
I tried with zip(), but get a list of tuples, which isn't the desired
output. Anyone with a solution or push in the right direction?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor