Python - MCQ
Multiple Choice Questions
Python - Multiple Choice Questions (MCQ) - Python functions, Modules and Packages - Set 22
16. What will be the output of the following Python function? min(max(False,-3,-4), 2,7)
A). 2
B). False
C). -3
D). -4
View Answer
Correct: B
17. A Python module is a file with the _____ file extension that contains valid Python code.
A). .pym
B). .pymodule
C). .module
D). .py
View Answer
Correct: D
18. To use a module in another module, you must import it using an ________ statement
A). import
B). include
C). both A and B
D). none of the above
View Answer
Correct: A
19. A package is a folder containing one or more Python modules. One of the modules in a package must be called _______.
A). __package__.py
B). __main__.py
C). main.py
D). init.py
View Answer
Correct: Answer
20. Which statement is correct to import all modules from the package
A). from package import all
B). from package import *
C). from package include all
D). from package include *
View Answer
Correct: B