[Tutor] Unexpected iterator
Jeff R. Allen
jra at nella.org
Thu Nov 12 10:03:58 CET 2009
Hello,
I am working my way through the tutorial, and I like trying
variations, just to see what expected errors look like, and other ways
things could be written.
I tried a, b = 0, 0 and that worked.
Then I tried this to (maybe) set both a and b to 0:
>>> a, b = 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable
I understand why it doesn't work, but I don't understand the wording
of the exception. Could someone explain how I accidentally introduced
iteration into the picture with my syntax? I have a feeling there's an
interesting lesson hidden in this example...
Thanks.
-jeff
More information about the Tutor
mailing list