PCAP-31-03 · Question #74
Can a module run like regular code?
The correct answer is A. yes, and it can differentiate its behavior between the regular launch and import. it can differentiate its behavior between the regular launch and import Module have 2 users.One is the creator and other is the module users.The creator can execute his module and check the functionality using __name__ variable.Normal module users can execute the module by…
Question
Can a module run like regular code?
Options
- Ayes, and it can differentiate its behavior between the regular launch and import
- Bit depends on the Python version
- Cyes, but it cannot differentiate its behavior between the regular launch and import
- Dno. it is not possible; a module can be imported, not run
How the community answered
(14 responses)- A86% (12)
- C7% (1)
- D7% (1)
Explanation
it can differentiate its behavior between the regular launch and import Module have 2 users.One is the creator and other is the module users.The creator can execute his module and check the functionality using name variable.Normal module users can execute the module by using import.
Topics
Community Discussion
No community discussion yet for this question.