DEV Community

Cover image for Let’s learn about the special variable __name__ in python.
Shaila B
Shaila B

Posted on

Let’s learn about the special variable __name__ in python.

In python, there is no main() function. When we run a python program, the code is given to the interpreter, then the given code is to be executed at the level 0 indentation, before doing that it will define a few special variables. name is one such special variable. name is a special variable that will store the current module name.
Syntax : name
A image showing 40% responded "Yes", 50% responded "No" and 10% responded "Not sure"
A image showing 40% responded "Yes", 50% responded "No" and 10% responded "Not sure"
A image showing 40% responded "Yes", 50% responded "No" and 10% responded "Not sure"
A image showing 40% responded "Yes", 50% responded "No" and 10% responded "Not sure"

Top comments (0)