

What if you were reading a file and you wanted to close the file whether or not an exception was raised? This can be done using thefinally block. Note that you can use anexcept clause along with afinally block for the same correspondingtry block. You will have to embed one within another if you want to use both.