VITyarthi Python Essentials Module 10 Quiz Answer

Question 1

Question 661A Python module is a file with the _____ file extension that contains valid Python cod?

  1. .module
  2. .pymodule
  3. .pym
  4. .py

4.  .py

Question 2

To use a module in another module, you must import it using an ________ statement.?

  1. include
  2. import
  3. both A and B
  4. none of the above

2. import

Question 3

A package is a folder containing one or more Python modules. One of the modules in a package must be called _______.?

  1. __package__.py
  2. __main__.py
  3. __init__.py

4. __init__.py

Question 4

Which statement is correct to import all modules from the package??

  1. from package import all
  2. from package import *
  3. from package include all
  4. from package include *

2. from package import *

Question 5

Suppose a function called add() is defined in a module called adder.py. Which of the following code snippets correctly shows how to import and use the add() function? Select all that apply.?

(A) from adder import add result = adder.add(2, 3)

(B) from adder import add result = add(2, 3)

(C) import adder result = adder.add(2, 3)

(D) import add from adder result = add(2, 3)

Both (A) and (B)(Student answer)

Both (A) and (B)(Student answer)

Question 6

To use a module in another module, you must import it using an ________ statement.?

import

Question 7

Use of packages helps —-?

  1. importing any modules one at a time
  2. importing any modules all at a time
  3. importing any modules, both individually and whole
  4. None of the modules

3. importing any modules, both individually and whole

Question 8

Choose all the staements that are applicable to packages?

  1. A python package is a collection of modules.
  2. Functions, modules and packages are interrelated
  3. Modules that are related to each other are mainly put in the same package.
  4. All the above

4. All the above

Question 9

Which are the statements applicable to itertools?

  1. It is used for fastest caculation
  2. Memory efficiency
  3. Itertools is an inbuilt module

4. All the above

If you find anything wrong in this Answer Key, feel free to reach us in the comment section.

Sharing Is Caring:

Leave a Comment