Creating variables from dicts

Tim Chase python.list at tim.thechases.com
Tue Feb 23 18:41:37 EST 2010


Luis M. González wrote:
> If you want a list of items, you use tuples or lists. Examples:
> 
>     ('a', 'm', 'p') ---> this is a tuple, and it's made with
> parenthesis ()

Actually, a tuple is made with commas...the parens are just there 
to clarify the order of operations and make it easier to read :)

   >>> x = 1,2,3
   >>> x
   (1, 2, 3)

-tkc








More information about the Python-list mailing list