if __name__ == __'main'__ : | Name Variable in Python | Python Tutorial for Beginners

Veröffentlicht am: 10 November 2018
auf dem Kanal: Bytes
651
27

welcome to Bytes
Bytes Easy way to learn Python in Tamil
Bytes Python Tutorial

_name_ (A Special variable) in Python Since there is no main() function in Python,
when the command to run a python program is given to the interpreter,
the code that is at level 0 indentation is to be executed.
However, before doing that, it will define a few special variables.
_name_ is one such special variable.
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.
_name_ is a built-in variable which evaluates to the name of the current module.


Auf dieser Seite können Sie das Online-Video if __name__ == __'main'__ : | Name Variable in Python | Python Tutorial for Beginners mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Bytes 10 November 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 651 Mal angesehen und es wurde von 27 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!