[Tutor] What does "TypeError: 'int' object is not iterable" mean?

Emmanuel Ruellan emmanuel.ruellan at laposte.net
Thu Oct 21 15:00:36 CEST 2010


On Thu, Oct 21, 2010 at 2:42 PM, Richard D. Moores <rdmoores at gmail.com>wrote:


Traceback (most recent call last):
 File "c:\P26Working\test_urllib2_
>
> 21a.py", line 148, in <module>
>    unchanged_count, higher_count, lower_count, secs =
> sleep_seconds_control(unchanged_count, higher_count, lower_count,
> secs)
> TypeError: 'int' object is not iterable
>
> I'm working on a script that keeps track of the USD -> Japanese Yen
> exchange rate. I'm experimenting with adding functionality that
> changes the seconds to sleep between web scrapes, depending on
> consecutive outputs of no change in the exchange rate. Please see the
> code at <http://tutoree7.pastebin.com/KWmdk8jb>
>
> I'm at a loss as to what the error means.



In line 148, you are trying to unpack the value returned by function
sleep_seconds_control, as if it were returning a tuple, a list or some sort
of iterable, whereas in lines 44 to 49, you defined it as returning a single
value.

-- 
Emmanuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101021/97ec60e8/attachment.html>


More information about the Tutor mailing list