#python #abhigna #abhignatechtutorials . Special variable in Python || _name__==__main_ || Python tutorials for beginners in Python
_name_ (A Special variable) in Python
If the source file is executed as the main program, the interpreter sets the _name_ variable to have a value “__main__”. If this file is being imported from another module, _name_ will be set to the module's name.
PYTHON MAIN FUNCTION is a starting point of any program. When the program is run, the python interpreter runs the code sequentially. Main function is executed only when it is run as a Python program. It will not run the main function if it imported as a module.
If the python interpreter is running that module (the source file) as the main program, it sets the special _name_ variable to have a value “__main__”. If this file is being imported from another module, _name_ will be set to the module’s name. Module’s name is available as value to _name_ global variable.
If you like my video, then like, share and SUSCRIBE.
thanku..
Copyright Notice:-
Please feel free to leave me a notice if You find this upload inappropriate.
Contact me personally if You are against an upload which You may have rights to the Images (or) music,
instead of contacting YouTube about a Copyright Infringement....Thank You..!"