PEP 276 Simple Iterator for ints
warkid at storm.ru
Thu Nov 29 12:45:32 CET 2001
Thursday, November 29, 2001, 5:18:43 AM, you wrote:
Jic> Peter Hansen wrote:
>>if not 0 <= index < len(mylist):
>> print 'index out of range'
Jic> Right. Which has the added advantage of not repeating index.
Why not just _use_ that index on the list to check whether it's valid?
print 'index out of range'
Kerim mailto:warkid at storm.ru
More information about the Python-list