Tim Arnold schrieb: > That looks much cleaner. I didn't know the 'num' from the enumerate would > persist so the except block could report it.
It's indeed guaranteed that the for loop index variables will keep the value they had when the loop stopped (either through regular termination, break, or an exception) (unlike list comprehensions, where the variable also stays, but only as a side effect of the implementation strategy). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list