PEP 276 Simple Iterator for ints

James_Althoff at i2.com James_Althoff at i2.com
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:

Jim





More information about the Python-list mailing list