Tommy, your enhanced for-loop suggestion works perfectly as well. That's how I originally thought of coding mine, but because I was having problems, I ended up changing it to a normal for-loop.
Not that it ever made a difference, the problem was with the
break on line 38, as well has having the exception as an
else clause. Much better to have the exception outside the for-loop, bypassing it with a
return statement if a match is found.
Ikpefua, thanks for your input. I haven't got to that part yet though

I promise I will have a look at your code when I get to the relevant chapters in my book. Cheers!