PEP 276 Simple Iterator for ints

James_Althoff at i2.com James_Althoff at i2.com
Wed Nov 28 18:36:20 EST 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