[Tutor] Dictionaries of Tuples of Strings
mail at timgolden.me.uk
Fri Feb 23 22:24:29 CET 2007
Luke Paireepinart wrote:
> That's because you can't make tuples of single values.
> Parenthesis are ways of controlling order of operation.
> They don't create tuples unless there's more than one value.
> Think of it like this:
> a TUple needs TWO elements or more.
> use lists. They can contain single elements.
Don't know where you got that one from:
t = (1,)
In fact, in a certain way, it's the comma which makes the tuple.
Brackets are only needed in some circs to disambiguate (eg in
parameter lists to functions)
t = 1,
More information about the Tutor