flat tuple

Alex Martelli aleaxit at yahoo.com
Tue Sep 21 08:12:31 EDT 2004


Will McGugan <news at NOwillmcguganSPAM.com> wrote:

> 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 ) )

Simplest is probably:

(n,) + t


Alex



More information about the Python-list mailing list