Python Dictionary type() method
Description
The Python Dictionary type() function returns the type of the input variable; if the variable is a dictionary, it returns the dictionary type.
Syntax
type() method syntax:
type(dict)
Parameters
- dict -- the dictionary.
Return Value
Returns the type of the input variable.
Example
The following example shows how to use the type() function:
Example
#!/usr/bin/python
tinydict
=
{
'Name'
:
'Zara'
,
'Age'
:
7
}
;
"Variable Type : %s"
%
type
(
tinydict
)
The output of the above example is:
Variable Type :
Python Dictionary