Q. 1

Which one is not correct ?

Options:

Explanation

Correct answer is : C

Attribute __name__ is created by default. But you can still assign a value to it

print(__name__)
__name__ = 'my module'
print(__name__)

Output :

main
my module

Discuss It

Q. 2

Which of the following is not correct about main modules?

Options:

Explanation

Correct answer is : B

Main modules are not meant to be imported into other modules or scripts that are directly run

Discuss It

Q. 3

Which of the statements about modules is false?

Options:

Explanation

Correct answer is : D

In the from .. import form of import, the private identifiers beginning with two underscores are not imported

Discuss It

Q. 4

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

Options:

Explanation

Correct answer is : D

Python first searches the local namespace, then the global namespace and finally the built-in namespace.

Discuss It
Submit Your Answers

Interview Questions

on
Modules

Tutorial

on
Modules

Programs

on
Modules
Click any Link
to navigate to certain page easily
Write a line to us
Your Email
Title
Description