try:
#statement 1
#statement 2
except Exception, err:
print err
pass
This may be very trivial but I never actually thought about it
The answer is "no" to both of your questions.
As soon as an error is thrown in a try/except
block, the try
part is immediately exited:
>>> try:
... 1/0
... print 'hi'
... except ZeroDivisionError, e:
... print 'error'
...
error
>>>
As you can see, the code never gets to the print 'hi'
part, even though I made an except
for it.
You can read more here.