len() returns the total number of items, that is, key-value pairs : length « Dictionary « Python Tutorial






dict2 = {'name': 'earth', 'port': 80}
print dict2
print len(dict2)
8.18.length
8.18.1.len() returns the total number of items, that is, key-value pairs