array next pointer
andreengels at gmail.com
Tue Mar 17 12:24:40 CET 2009
On Tue, Mar 17, 2009 at 12:12 PM, Anjanesh Lekshminarayanan
<mail at anjanesh.net> wrote:
>>>> a = ['cat','dog','elephant']
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> AttributeError: 'list' object has no attribute 'next'
> Is there something that imtates PHP's next() ? (http://php.net/next)
>>> b = a.__iter__()
However, in many cases the more Pythonic way of working will be to use
a for-loop (which is like a foreach-loop in PHP and other languages).
André Engels, andreengels at gmail.com
More information about the Python-list