When a module is imported, its contents:
- may be executed (explicitly)
- are executed as many times as they are imported
- are ignored
- are executed once (implicitly)
Explanation: When a module in Python is imported, the entire file is executed once implicitly in order to assure no errors are present in the module.
More Questions: Python Essentials 2 – Module 1 Test
Please login or Register to submit your answer