PEP 276 Simple Iterator for ints

James_Althoff at James_Althoff at
Thu Nov 29 00:36:20 CET 2001

Jeff Shannon wrote:
>Better still, and already valid:
>if index >= len(mylist):
>    print 'index out of range'

... although you would probably want to add the other condition as well:

    if index >= len(mylist) or index < 0:


More information about the Python-list mailing list