Friday , September 20 2024

Knowing that a function named fun() resides in a module named mod, and was imported using the following statement: from mod import fun Choose the right way to invoke the fun() function:

Questions BankCategory: Python Essentials 2Knowing that a function named fun() resides in a module named mod, and was imported using the following statement: from mod import fun Choose the right way to invoke the fun() function:
Knowing that a function named fun() resides in a module named mod, and was imported using the following statement:

from mod import fun

Choose the right way to invoke the fun() function:

  • mod:fun()
  • mod::fun()
  • fun()
  • mod.fun()

Explanation: The following import syntax: from module_name import entity allows you to import specific entities into the main namespace. The name of the imported entity is accessible without qualification, in which case the fun() function can be called using regular function call syntax.

More Questions: Python Essentials 2 (PE2) Course Final Test