My Report

Python Modules Test – 1


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. In top-down design every module is broken into same number of submodules.

2. Which of these definitions correctly describes a module?

3. Which of the statements about modules is false?

4. What will be the output of the following Python code?

from math import factorial
print(math.factorial(5))

5. Which of the following is not a valid namespace?

6. Program code making use of a given module is called a ______ of the module.

7. What will be the output of the following Python code?

#mod1
def change(a):
    b=[x*2 for x in a]
    print(b)
#mod2
def change(a):
    b=[x*x for x in a]
    print(b)
from mod1 import change
from mod2 import change
#main
s=[1,2,3]
change(s)

8. Which of the following is true about top-down design process?

9. ______ is a string literal denoted by triple quotes for providing the specifications of certain program elements.

10. Which of the following is false about “import modulename” form of import?

11. All modular designs are because of a top-down design process.

12. Which of the following is false about “from-import” form of import?

13. What is the order of namespaces in which Python looks for an identifier?

14. Which of the following isn’t true about main modules?

15. Which of the following is not an advantage of using modules?


 

Start practicing “1000 MCQs on Python”, and once you are ready, you can take tests on all topics by attempting our “Python Test Series”.

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.