interating over single element array

T. Crane tcrane at REMOVETHISuiuc.edu
Fri Jun 8 11:54:23 EDT 2007


>
>> any suggestions are appreciated,
>
> Yes, don't try iterating over objects that are not iterable.  ;-)

Ah, yes... I hadn't thought of that :)


thanks,
trevis

>
> What you *can* do is iterating over lists, tuples or other iterables with
> just one element in them.  Try ``a = [1]``.
>
> Ciao,
> Marc 'BlackJack' Rintsch 





More information about the Python-list mailing list