This function gives the total length of the dictionary. This would be equal to the number of items in the dictionary.
len(dict)
Here is the detail of parameters:
dict: This is the dictionary which length needs to be calculated.
#!/usr/bin/python dict = {'Name': 'Zara', 'Age': 7}; print "Length : %d" % len (dict)
This produces following result:
Length : 2
Advertisement