A script element can either load an external file or contain code, it can't do both. So to do both, at least two script elements are required.
So:
<script src="lib/calculator.js"></script>
loads a file, and
<script>
    calculator.init();
</script>
runs some code. If the code in the second element was included as content of the first, like:
<script src="lib/calculator.js">
    calculator.init();
</script>
the external file will be loaded but the element content (i.e. calculator.init()) will be ignored.
 
    