Tutorials Point


  Python Basics
  Python Advanced
  Python Useful References
  Python Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Python dictionary len() Function


previous next AddThis Social Bookmark Button


Description:

This function gives the total length of the dictionary. This would be equal to the number of items in the dictionary.

Syntax:

len(dict)

Parameters:

Here is the detail of parameters:

  • dict: This is the dictionary which length needs to be calculated.

Example:

#!/usr/bin/python

dict = {'Name': 'Zara', 'Age': 7};
print "Length : %d" % len (dict)

This produces following result:

Length : 2


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names