What does __ name __ mean in python?



What does __ name __ mean in python?..

Answer / Prem Chandra Verma

__name__ is a built-in variable in Python that returns the name of the current module (script or file). If the script is run directly, its value is set to __main__, otherwise it's the name of the imported module.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How to get current directory using python?

1 Answers  


What is flask?

1 Answers  


Does every class need a constructor?

1 Answers  


What is jinja python?

1 Answers  


What is instance method?

1 Answers  


Is python sorted stable?

1 Answers  


Which methods of python are used to determine the type of instance and inheritance?

1 Answers  


How do you concatenate strings in python?

1 Answers  


Rules for local and global variables in python?

1 Answers  


Explain me what are the principal differences between the lambda and def?

1 Answers  


With python, how do you find out which directory you are currently in?

1 Answers  


What are the built-in types of python?

1 Answers  


Categories