Python type() Function

Python type() Function

The type() function in Python returns the type of an object. The return value is a type object and generally the same object as returned by object.__class__.

Syntax

              or

Parameter

object- If only one parameter is specified, the type() function returns the type of this object.

base- It is an optional parameter that specifies the base classes.

dict- This parameter specifies the namespace with the definition for the class.

Return

This function returns the type of an object.

Example 1

Output

Example 2

Output