[Tutor] Sets question

eryk sun eryksun at gmail.com
Wed Apr 26 21:58:39 EDT 2017


On Thu, Apr 27, 2017 at 1:34 AM, Phil <phil_lor at bigpond.com> wrote:
> I did try {int(num)} but that resulted in an error that said something along
> the lines of int not being iterable. I'll have another look at that idea.

That exception indicates you probably used set(int(num)) instead of
either {int(num)} or set([int(num)]). The set() constructor needs an
iterable container such as a sequence (e.g. range, list, tuple, str).
An integer isn't iterable.


More information about the Tutor mailing list