type()
function is used to find the type of the given object. If three arguments (name, bases and dict) are passed, it returns a new type object in Python for the given input.
type()
function is a part of Python Built-in Functions.
Syntax of type()
Function
The syntax of
type()
function in Python is:
type(object) type(name, bases, dict)
Parameters of type()
Function in Python
x
– Where x
is any valid . This parameter is required.
Compatibility
type()
function is available and compatible with both Python 2.x
and 3.x
.
Return Value of type()
Function in Python
type()
function returns type of the given object. If three arguments (name, bases and dict) are passed, it returns a new type object for the given input.
Python type()
Function Example 1
Example CODE
Output:
Python type()
Function Example 2
Example CODE
Output: