Why tuple with one item is no tuple
timr at probo.com
Wed Mar 16 08:54:35 CET 2005
Gregor Horvath <g.horvath at mx.at> wrote:
>I wonder why ('1') is no tuple????
There were lots of answers, but I'm not sure I saw the "why" addressed.
a = (3 + 5) * 5
You really, really want (3 + 5) to be an integer, not a one-item tuple.
- Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the Python-list