setting variables from a tuple NEWB

Steven D'Aprano steve at REMOVETHIScyber.com.au
Fri Jul 7 08:07:20 EDT 2006


On Thu, 06 Jul 2006 04:20:01 -0700, manstey wrote:

> Hi,
> 
> If I have a tuple like this:
> 
> tupGlob = (('VOWELS','aeiou'),('CONS','bcdfgh'))
> 
> is it possible to write code using tupGlob that is equivalent to:
> VOWELS = 'aeiou'
> CONS = ''bcdfgh'

Why don't you just do that?

VOWELS = 'aeiou'
CONS = 'bcdfgh'

What benefit do you gain by stuffing your variables into tuples?



-- 
Steven.




More information about the Python-list mailing list