[EMAIL PROTECTED] wrote:

for i, x in enumerate(collatz(13)):
  try:
    last = x[:i+1]
    print x[:i+1]
  except StopIteration:
    print last.appnd(1)

My guess would be because StopIteration is raised when control returns to the for loop and sees that it has nothing else left. At that point, you aren't in the try statement and so the exception can't be caught that way. But I should let the experts answer. I need to go to bed anyway! :)
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to