Main Function In Python
Syntax : if __name__ = '__main__'
- Module can be run as a standalone Program
- Module can be imported and used by other module
- Python interpreter sets "special variables", one of which is
__name__ then python will execute the code found within '__main__'.
- Python will assign the
__name__ variable of a value of '__main__' if its the initial module being run.