Regarding indenation and formatting check this post, it will help in the future- FAQ-formatting.
I assume this script is intended to just show the basics of how try, except and raise might be used with a function that always raises a specific exception. I’m not really sure what you’d be using try and except on in this particular function if you moved them but you could certainly explore their usage with your own functions.
If your questions is a little more generalised about where to use try & except etc. there’s no one-size-fits-all rule for handling errors. It often differs between projects and is influecned heavily by the overall purpose of your code; for now it’s probably best to just continue with the lessons which I assume add more detail (potentially some sensible examples too).
Keep a note of it by all means for something to look into in the future though if you don’t feel the lessons have covered enough for you, there’s numerous posts, blogs, guides and book chapters devoted to handling errors.