logo

Python Dictionary Type() Method


Show

Description

Python dictionary method type() revisits the kind of the past changeable. If passed changeable is lexicon then it would homecoming a dictionary type. Type() technique returns group type of the argument(object) bypassed as parameter. Type () meaning is typically utilized for debugging purposes. If solitary argument type (obj) is bypassed, it returns the category of known objects. If three arguments type(name, bases, dict) is bypassed, it revisits a new nature object.

Syntax

Following is the syntax for type() method:

type(dict)

Parameters

  • dict - This is the dictionary.

Return Value

This method returns the type of the passed variable.

Example

The following example shows the usage of type() method.

#!/usr/bin/python

dict = {'Name': 'Zara', 'Age': 7};
print "Variable Type : %s" %  type (dict)

When we run the above program, it produces the following result:

Variable Type : <type 'dict'>

Here at Intellinuts, we have created a complete Python tutorial for Beginners to get started in Python.