Cyber Monday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

GIAC Exam GPYC Topic 8 Question 41 Discussion

Actual exam question for GIAC's GPYC exam
Question #: 41
Topic #: 8
[All GPYC Questions]

What will the contents of the "__name__" variable be if the program "gpyc.py" is run as a standalone program?

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Glory
6 months ago
I believe it's because Python assigns __name__ the value __main__ when it's the main program being executed
upvoted 0 times
...
Viola
6 months ago
But why is it set to __main__ specifically?
upvoted 0 times
...
Cathrine
6 months ago
Yeah, I agree. When a Python program is run as a standalone program, __name__ is set to __main__
upvoted 0 times
...
Margot
7 months ago
I think the contents of the __name__ variable will be __main__
upvoted 0 times
...

Save Cancel