one-element tuples [Was: Most probably a stupid question, but I still want to ask]

Dan Sommers dan at tombstonezero.net
Sun Apr 10 22:22:07 EDT 2016


On Mon, 11 Apr 2016 01:33:10 +0100, MRAB wrote:

> There _is_ one exception though: (). It's the empty tuple (a 0-element
> tuple). It doesn't have a comma and the parentheses are mandatory.
> There's no other way to write it.

The other way to write it is:

    tuple()



More information about the Python-list mailing list