Explanation for trailing comma in example from Learning Python?
lists at cheimes.de
Thu Feb 19 15:54:34 EST 2009
Carl Schumann wrote:
> I could see the logic in always or never having a trailing comma. What
> I don't understand here is why only the single element case has a
> trailing comma. Any explanations please?
Does this code shad some light on the trailing comma? :)
>>> (1) == 1
>>> (1,) == 1
>>> a = 1
>>> a = (1)
>>> a = (1,)
>>> a = 1,
More information about the Python-list