Python – Advanced Function Called by __import__() Function with Examples

__import__() function is used to find the advanced function that is called by the import statement in Python for the given input.

__import__() function is a part of Python Built-in Functions.

Syntax of __import__() Function

The syntax of __import__() function in Python is:

 

Parameters of __import__() Function in Python

x – Where x is any valid . This parameter is required.

 

Compatibility

__import__() function is available and compatible with both Python 2.x and 3.x.

 

Return Value of __import__() Function in Python

__import__() function returns an advanced function that is called by the import statement for the given input.