2 Réponses
+ 1
__name__ is a special variable that tells the script the scope it's called from. When importing the file, the __name__ will be the calling script, if the file is executed from the REPL, directly or through the standard input, __name__ will be "__main__"
+ 1
My other answer
https://www.sololearn.com/discuss/1090729/?ref=app