Thursday , September 19 2024

When a module is imported, its contents:

Questions BankCategory: Python Essentials 2When a module is imported, its contents:
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