For debugging-in-REPL purposes it's often very convenient to have it both ways. I was taught as a beginner to treat it as idiomatic boilerplate for that reason--no harm in having it, and there when you need it. Then you can just import your script and ad hoc test your functions.
It's a good technique prior to introducing formal unit testing (and even then, supplemental ad hoc has advantages).