If a Python file is part of a library, all of its code runs the first time it is imported. This can be problematic if
the file is a program on its own that, for example, interacts with the user—the importing code probably does
not want any of those user interactions. Therefore, Python defines a special variable, __name__
that
is set to the string '__main__'
only in the file that is actually being run, not in any imported files.
Python files can check this variable and only run as a program if it is set to '__main__'
.
Fill in the placeholders so that file detects that it is the main program.