Explain Try, Except and Else statement in Python.
I have the following code that throws an exception as follows
a = [11, 8, 9, 2]
try:
foo = a[5]
except:
print "index out of range"
showing output as
index out of range
How do I rewrite this code to use the else clause?