+ 1
what is __name__ in Python
1 Answer
+ 2
Before programs are executed, special variables are defined. Take into account, you're running your program from a source file and that source file is like your main program. A special variable that's called __name__ will have the value of '__main__'. If you're importing the module to like another module __name__ will have the value of the module's name instead of '__main__'.
All in all, it's not too hard of a concept. If you're confused I would strongly recommend for you to search it up. You might learn something new