w3resource

Python: Import built-in array module and display the namespace of the said module


Write a Python program to import a built-in array module and display the namespace of the said module.

Sample Solution:

Python Code:

import array
for name in array.__dict__:
    print(name)

Sample Output:

__name__
__doc__
__package__
__loader__
__spec__
_array_reconstructor
ArrayType
array
typecodes 

Flowchart:

Flowchart: Import built-in array module and display the namespace of the said module

Python Code Editor:

Contribute your code and comments through Disqus.

Previous: Python Class exercises.
Next: Write a Python program to create a class and display the namespace of the said class.

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.