PEP 276 Simple Iterator for ints
Peter Hansen
peter at engcorp.com
Wed Nov 28 20:47:21 EST 2001
More information about the Python-list mailing list
Wed Nov 28 20:47:21 EST 2001
- Previous message (by thread): PEP 276 Simple Iterator for ints
- Next message (by thread): PEP 276 Simple Iterator for ints
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
James_Althoff at i2.com wrote: > > 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: Or just: if not 0 <= index < len(mylist): print 'index out of range' -- ---------------------- Peter Hansen, P.Eng. peter at engcorp.com
- Previous message (by thread): PEP 276 Simple Iterator for ints
- Next message (by thread): PEP 276 Simple Iterator for ints
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list