Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python Dictionary type() method

Python Dictionary type() method

Python Dictionary Python Dictionary


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

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

}

;

print

"Variable Type : %s"

%  

type

(

tinydict

)

The output of the above example is:


Variable Type : 

Python Dictionary Python Dictionary