Question #77

Which value does the Python interpreter assign to __name__ when running the source file foo.py directly?

When the Python interpreter runs a file directly, it assigns the value __main__ to the variable __name__ for that source file. If the file foo.py is imported from a different file, then the interpreter will assign the variable __name__ of foo.py to foo . (freecodecamp.org/news/whats-in-a-python-s-name-506262fe61e8)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵