[Tutor] What does "TypeError: 'int' object is not iterable" mean?
Alan Gauld
alan.gauld at btinternet.com
Thu Oct 21 16:43:05 CEST 2010
"Richard D. Moores" <rdmoores at gmail.com> wrote
> 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 at a loss as to what the error means.
a.. def sleep_seconds_control(unchanged_count, higher_count,
lower_count, secs):
a.. if unchanged_count >= 2:
a.. secs += 5
a.. else:
a.. secs = 10
a.. return secs
You return secs
You try to assign that single value to 4 variables.
Python tries to do it and finds that it can't break secs into 4 bits
because
its not a sequence(not iterable).
HTH,
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
More information about the Tutor
mailing list