C++ and javascript are languages of professional software engineers, of which there are many many more languages with various pros and cons.
Python has been the defacto standard in scientific/data/academic programming for decades. The only other language you could say rivals it would be MATLAB which is even more simplistic.
My point is that simplicity and clarity matters to people who don't care that much about programming and are completely unfocused on it, they are just using it do get data for unrelated research.
'if __name__ == "__main__"' is not in the example code nor is it a required part of a python program so not really sure what your point is here.