flat tuple

Will McGugan news at NOwillmcguganSPAM.com
Tue Sep 21 13:58:08 CEST 2004


Hi,

What is the simplest way of turning a single value and a tuple in to a 
single 'flat' tuple?

ie.

t= ( 1, 2, 3 )
n= 10

n, t gives me ( 10, ( 1, 2, 3 ) )

Fair enough, but I would like to get.. ( 10, 1, 2, 3 )

I would like to use the result to create a string with the % operator - 
I was hoping there was some shorthand to produce ( n, t[0], t[1], t[2] ).

Thanks,

Will McGugan



More information about the Python-list mailing list